Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#14168 closed defect (bug) (fixed)

Redundant line in WP_Http

Reported by: rmccue's profile rmccue Owned by: rmccue's profile 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 15 years ago.
One-liner patch

Download all attachments as: .zip

Change History (9)

@rmccue
15 years ago

One-liner patch

#1 @johnjamesjacoby
15 years ago

I like it alot. Outstanding jorb.

#2 @rmccue
15 years ago

  • Keywords has-patch added

Oh wow, forgot this.

#3 follow-ups: @Viper007Bond
15 years ago

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

#4 in reply to: ↑ 3 @nacin
15 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.

#5 in reply to: ↑ 3 @rmccue
15 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.

#6 @Viper007Bond
15 years ago

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

#7 @dd32
15 years ago

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

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

#8 @dd32
15 years ago

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