Skip to content

Commit

Permalink
Regex: In a character class, a dash doesn't need to be escaped if it'…
Browse files Browse the repository at this point in the history
…s the last entry in the list. Also, $key is already uppercase, so there's no need to use the case-insensitive flag.
  • Loading branch information
YahnisElsts committed Sep 28, 2014
1 parent 18f5be5 commit a49dc35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Wpup/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function parse($environment) {
$key = strtoupper($key);
if ( self::isHeaderName($key) ) {
//Remove the "HTTP_" prefix that PHP adds to headers stored in $_SERVER.
$key = preg_replace('/^http[_\-]/i', '', $key);
$key = preg_replace('/^HTTP[_-]/', '', $key);
$results[$key] = $value;
}
}
Expand Down

0 comments on commit a49dc35

Please sign in to comment.