@@ -464,11 +464,11 @@ |
||
| 464 | 464 | private function httpParseHeaders($header) { |
| 465 | 465 | $retVal = array(); |
| 466 | 466 | $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header)); |
| 467 | - foreach( $fields as $field ) { |
|
| 468 | - if( preg_match('/([^:]+): (.+)/m', $field, $match) ) { |
|
| 467 | + foreach ($fields as $field) { |
|
| 468 | + if (preg_match('/([^:]+): (.+)/m', $field, $match)) { |
|
| 469 | 469 | $match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1]))); |
| 470 | - if( isset($retVal[$match[1]]) ) { |
|
| 471 | - if ( is_array( $retVal[$match[1]] ) ) { |
|
| 470 | + if (isset($retVal[$match[1]])) { |
|
| 471 | + if (is_array($retVal[$match[1]])) { |
|
| 472 | 472 | $i = count($retVal[$match[1]]); |
| 473 | 473 | $retVal[$match[1]][$i] = $match[2]; |
| 474 | 474 | } |
@@ -471,8 +471,7 @@ |
||
| 471 | 471 | if ( is_array( $retVal[$match[1]] ) ) { |
| 472 | 472 | $i = count($retVal[$match[1]]); |
| 473 | 473 | $retVal[$match[1]][$i] = $match[2]; |
| 474 | - } |
|
| 475 | - else { |
|
| 474 | + } else { |
|
| 476 | 475 | $retVal[$match[1]] = array($retVal[$match[1]], $match[2]); |
| 477 | 476 | } |
| 478 | 477 | } else { |