[wp-trac] Re: [WordPress Trac] #8620: Fatal error with HTTP class

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 28 00:49:56 GMT 2009


#8620: Fatal error with HTTP class
---------------------------+------------------------------------------------
 Reporter:  momo360modena  |        Owner:  westi   
     Type:  defect (bug)   |       Status:  reopened
 Priority:  high           |    Milestone:  2.8     
Component:  HTTP           |      Version:  2.7     
 Severity:  major          |   Resolution:          
 Keywords:  has-patch      |  
---------------------------+------------------------------------------------
Changes (by hakre):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 Replying to [comment:17 DD32]:
 > > attachment 8620.diff added
 >  * A few PHPDoc updates based on previous patches and comments
 >  * Added a WP_Error check on the helper functions (Note: The example
 code in the OP's description would never cause that error, due to the
 is_wp_error() check, But not everyone is going to do that check, as
 evident by that error message)
 >  * I didnt see the point of Denis's isset() changes, infact, I suspect
 they'd cause notices to be thrown (isset($arr['one']['two']) throws a one
 is unset i think under some conditions)

 Added an additional patch to remove some faults in the code. First of all,
 I am pretty shure there is no collision between a valid $response and
 wp_error. So it was hardworking to add the checks everywhere, but those
 should not be really necessary because isset() does a propper job here.

 Infact, the (In [11091]) patch will throw errors/notices/warnings if
 $response['response'] is set and an array but does not contain a key
 called 'message'.

 Isset() instead never notices on an unset variable or array by definition
 (otherwise please provide proof). Therefore my little patch adds it to the
 functions I had it in earlier. I might add another one soon cleaning out
 the other unnecessary and maybe incomplete checks.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8620#comment:19>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list