diff options
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/headers.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/data/headers.php b/test/data/headers.php index c3cb72961..d500b16f4 100644 --- a/test/data/headers.php +++ b/test/data/headers.php @@ -6,15 +6,11 @@ $headers = array(); foreach( $_SERVER as $key => $value ) { - if ( substr( $key , 0 , 5 ) == "HTTP_" ) { - - $key = str_replace( "_" , "-" , substr( $key , 5) ); - $headers[ $key ] = $value; - - } + $key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key ); + $headers[ $key ] = $value; } foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) { - echo "$key: " . $headers[ strtoupper( $key ) ] . "\n"; + echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n"; } |