Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8591 closed defect (bug) (invalid)

PHP Error with WP_Error

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

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 18 years ago.
8591a.diff​ (2.7 KB ) - added by vladimir_kolesnikov 18 years ago.

Download all attachments as: .zip

Change History (13)

#1 @mattyrob
18 years ago

  • Severity critical → 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
18 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
18 years ago

  • Keywords has-patch added

#4 @vladimir_kolesnikov
18 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
18 years ago

  • Priority highest omg bbq → normal
  • Summary White Screen on Publish → 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
18 years ago

  • Component General → HTTP
  • Owner anonymous removed

#7 @ryan
18 years ago

Addressed by [10282]?

#8 follow-up: @ryan
18 years ago

And [10281].

#9 in reply to: ↑ 8 @vladimir_kolesnikov
18 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
18 years ago

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

#11 @jacobsantos
18 years ago

  • Milestone 2.7.1
  • Resolution → invalid
  • Status new → 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.