Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12761 closed defect (bug) (fixed)

Bug in cookie WP HTTP cookie parsing

Reported by: josephscott's profile josephscott Owned by: dd32's profile dd32
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.2
Component: HTTP API Keywords: has-patch
Focuses: Cc:

Description

There's a small logic bug in the WP HTTP cookie code that will result in a PHP error. The code does an empty check, which is fine, but doesn't take into account the condition where the variable holds a string of spaces. To fix this I've included a small patch to rtrim() the value first, allowing for the empty check to work for this cases.

I ran into this while tracking down an error for some outbound PuSHPress pings on WordPress.com. It was triggering a PHP fatal error because it resulted in an empty object property trying to be referenced.

Attachments (1)

wp-includes--class-http.php.diff (635 bytes) - added by josephscott 14 years ago.

Download all attachments as: .zip

Change History (2)

#1 @dd32
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [13887]) Whitespace only Cookie pairs are not permitted; Skip them. Props josephscott. Fixes #12761

Note: See TracTickets for help on using tickets.