Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12316 closed defect (bug) (fixed)

WP_HTTP doesnt handle 'HttpOnly' cookies correctly

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

Description

Spits on an error: Notice: Undefined offset: 1 in G:\www\wordpress-commit\wp-includes\class-http.php on line 1737

This is due to $pair being set to " HttpOnly" at list( $key, $val ) = explode( '=', $pair );}

An example site of this is http://google.com/

Attachments (2)

12316.diff (841 bytes) - added by sivel 15 years ago.
Make sure that $pair is really a pair, if not set $key to $pair and $val to
12316.2.diff (785 bytes) - added by sivel 15 years ago.

Download all attachments as: .zip

Change History (6)

@sivel
15 years ago

Make sure that $pair is really a pair, if not set $key to $pair and $val to

#1 @sivel
15 years ago

  • Cc matt@… added
  • Keywords has-patch needs-testing added

#2 @nacin
15 years ago

I imagine this would work as well?

list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' );

#3 @sivel
15 years ago

Yes, that would work too.

@sivel
15 years ago

#4 @nacin
15 years ago

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

(In [13302]) Fix notice in WP_Http. Fixes #12316 props sivel.

Note: See TracTickets for help on using tickets.