WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#8591 closed defect (bug) (invalid)

PHP Error with WP_Error

Reported by: mattyrob Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: HTTP API Keywords: has-patch developer-feedback
Focuses: Cc:

Description

I'm getting a white screen on my main WordPress site when I Publish a post since starting to use 2.7.

My server error logs contain the following that matches time wise for every white screen I've seen:

PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/prescrib/public_html/wp-includes/comment.php on line 1264

I have disabled all plugins and still get this error. (Strangely, this is not reproducible on my localhost dev WordPress so there may be some server settings involved too.

Attachments (2)

8591.diff (519 bytes) - added by vladimir_kolesnikov 10 years ago.
8591a.diff (2.7 KB) - added by vladimir_kolesnikov 10 years ago.

Download all attachments as: .zip

Change History (13)

#1 @mattyrob
10 years ago

  • Severity changed from critical to normal

And stranger still, if I amend the function that appear to be generating this error by adding a:

return false;

immediately the function is called I don't get the error in the logs but I still get a white screen!?!

#2 @vladimir_kolesnikov
10 years ago

This might happen when WP_Http_Fsockopen::chunkTransferDecode() fails to decode the response. In this case, $responsebody? becomes WP_Error, not a string:

$process['body'] = WP_Http::chunkTransferDecode($process['body']);

Need to add one extra check to discover_pingback_server_uri().

#3 @vladimir_kolesnikov
10 years ago

  • Keywords has-patch added

#4 @vladimir_kolesnikov
10 years ago

  • Keywords developer-feedback added

Attached a better patch that takes care of other places from which wp_remote_get()/wp_remote_post() are called.

#5 @MattyRob
10 years ago

  • Priority changed from highest omg bbq to normal
  • Summary changed from White Screen on Publish to PHP Error with WP_Error

I went back to basic and wiped my WordPress install and re-uploaded the core files fresh. This has resolved the white screen issue. Maybe the patch will fix the Error Log entry

#6 @ryan
10 years ago

  • Component changed from General to HTTP
  • Owner anonymous deleted

#7 @ryan
10 years ago

Addressed by [10282]?

#8 follow-up: @ryan
10 years ago

And [10281].

#9 in reply to: ↑ 8 @vladimir_kolesnikov
10 years ago

Replying to ryan:

And [10281].

Need to update PhpDoc for chunkTransferDecode(), say:

- * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success.
+ * @return bool|string False if not chunked encoded. Chunked decoded body on success.

#10 @vladimir_kolesnikov
10 years ago

Yes, from what I can tell that seems to have fixed the problem.

#11 @jacobsantos
10 years ago

  • Milestone 2.7.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Addressed upstream in #8618. PHPdoc is also fixed in that ticket for both 2.7 and trunk.

Note: See TracTickets for help on using tickets.