Skip to content

Commit

Permalink
preg_replace with the /e modifier is deprecated in PHP 5.5+, switch t…
Browse files Browse the repository at this point in the history
…o using preg_replace_callback
  • Loading branch information
brendo committed Feb 5, 2016
1 parent 1e48f9c commit ef1cbf5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/class.image.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ public static function parseHttpHeaderFields($header){
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
foreach( $fields as $field ){
if( preg_match('/([^:]+): (.+)/m', $field, $match) ){
$match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
$match[1] = preg_replace_callback('/(?<=^|[\x09\x20\x2D])./', function($matches) {
return strtoupper($matches[0]);
}, strtolower(trim($match[1])));
if( isset($retVal[$match[1]]) ){
$retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
}
Expand Down

0 comments on commit ef1cbf5

Please sign in to comment.