@@ -941,6 +941,42 @@ private static function setFoldersInner( &$newFolders, &$newLongest, $folder ) {
941941 }
942942 }
943943
944+ private static function getRequestHeaders () {
945+ if ( function_exists ('getallheaders ' ) ) {
946+ return getallheaders ();
947+ } else {
948+ $ headers = array ();
949+
950+ foreach ( $ _SERVER as $ key => $ value ) {
951+ if ( strpos ($ key , 'HTTP_ ' ) === 0 ) {
952+ $ key = str_replace ( " " , "- " , ucwords (strtolower ( str_replace ("_ " , " " , substr ($ key , 5 )) )) );
953+ $ headers [ $ key ] = $ value ;
954+ }
955+ }
956+
957+ return $ headers ;
958+ }
959+ }
960+
961+ private static function getResponseHeaders () {
962+ if ( function_exists ('apache_response_headers ' ) ) {
963+ return apache_response_headers ();
964+ } else {
965+ $ headers = array ();
966+
967+ if ( function_exists ('headers_list ' ) ) {
968+ $ hList = headers_list ();
969+
970+ foreach ($ hList as $ header ) {
971+ $ header = explode (": " , $ header );
972+ $ headers [ array_shift ($ header ) ] = trim ( implode (": " , $ header ) );
973+ }
974+ }
975+
976+ return $ headers ;
977+ }
978+ }
979+
944980 public static function identifyTypeHTML ( $ arg , $ recurseLevels =1 ) {
945981 if ( ! is_array ($ arg ) && !is_object ($ arg ) ) {
946982 if ( is_string ($ arg ) ) {
@@ -2145,6 +2181,9 @@ public function reportError( $code, $message, $errLine, $errFile, $stackTrace=nu
21452181 session_start ();
21462182 }
21472183
2184+ $ request = ErrorHandler::getRequestHeaders ();
2185+ $ response = ErrorHandler::getResponseHeaders ();
2186+
21482187 $ dump = $ this ->generateDumpHTML (
21492188 array (
21502189 'post ' => ( isset ($ _POST ) ? $ _POST : array () ),
@@ -2153,8 +2192,8 @@ public function reportError( $code, $message, $errLine, $errFile, $stackTrace=nu
21532192 'cookies ' => ( isset ($ _COOKIE ) ? $ _COOKIE : array () )
21542193 ),
21552194
2156- getallheaders () ,
2157- apache_response_headers () ,
2195+ $ request ,
2196+ $ response ,
21582197
21592198 $ _SERVER
21602199 );
0 commit comments