WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14168 closed defect (bug) (fixed)

Redundant line in WP_Http

Reported by: rmccue Owned by: rmccue
Milestone: 3.1 Priority: normal
Severity: trivial Version: 3.0
Component: HTTP API Keywords: has-patch
Focuses: Cc:

Description

WP_Http has a redundant line, where it strtolower()s a field name after it has already been strtolower()ed.

Attached patch fixes.

(I didn't think it was worth the ticket, but hey, jjj convinced me ;) )

Attachments (1)

14168.diff (419 bytes) - added by rmccue 4 years ago.
One-liner patch

Download all attachments as: .zip

Change History (9)

rmccue4 years ago

One-liner patch

comment:1 johnjamesjacoby4 years ago

I like it alot. Outstanding jorb.

comment:2 rmccue4 years ago

  • Keywords has-patch added

Oh wow, forgot this.

comment:3 follow-ups: Viper007Bond4 years ago

Not to mention it's doing == and not === so the capitalization doesn't matter. :)

comment:4 in reply to: ↑ 3 nacin4 years ago

Replying to Viper007Bond:

Not to mention it's doing == and not === so the capitalization doesn't matter. :)

var_dump( 'test' == 'Test' );
var_dump( 'test' === 'Test' );
bool(false) bool(false)

Equals versus identical has to do with type. Capitalization changes the value itself.

comment:5 in reply to: ↑ 3 rmccue4 years ago

Replying to Viper007Bond:

Not to mention it's doing == and not === so the capitalization doesn't matter. :)

IIRC, only !strcasecmp($x, $y) would compare strings case-insensitively.

comment:6 Viper007Bond4 years ago

I think I've made this mistake before. I keep thinking 'test' == 'Test' but 'test' !== 'Test'. Whoops. :)

comment:7 dd324 years ago

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

(In [15362]) Remove redundant strtolower() in WP_HTTP. Props rmccue. Fixes #14168

comment:8 dd324 years ago

  • Milestone changed from Awaiting Review to 3.1
Note: See TracTickets for help on using tickets.