WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#12316 closed defect (bug) (fixed)

WP_HTTP doesnt handle 'HttpOnly' cookies correctly

Reported by: dd32 Owned by: 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 5 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 5 years ago.

Download all attachments as: .zip

Change History (6)

@sivel5 years ago

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

comment:1 @sivel5 years ago

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

comment:2 @nacin5 years ago

I imagine this would work as well?

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

comment:3 @sivel5 years ago

Yes, that would work too.

@sivel5 years ago

comment:4 @nacin5 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.