Small cleanup in JsHttpRequest.
authorCambell Prince <cambell.prince@gmail.com>
Fri, 9 Jan 2015 18:53:09 +0000 (19:53 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 9 Jan 2015 18:53:09 +0000 (19:53 +0100)
includes/JsHttpRequest.php

index 1ef9a815e65ae288e980250a112a533e5daa7279..78b0b2ce7e88a28933f26eb5fcc2f75f542c591d 100644 (file)
@@ -71,7 +71,7 @@ class JsHttpRequest
         $GLOBALS['_RESULT'] =& $this->RESULT; 
         
         // Parse QUERY_STRING.
-        if (preg_match('/^(.*)(?:&|^)JsHttpRequest=(?:(\d+)-)?([^&]+)((?:&|$).*)$/s', @$_SERVER['QUERY_STRING'], $m)) {
+        if (array_key_exists('QUERY_STRING', $_SERVER) && preg_match('/^(.*)(?:&|^)JsHttpRequest=(?:(\d+)-)?([^&]+)((?:&|$).*)$/s', @$_SERVER['QUERY_STRING'], $m)) {
             $this->ID = $m[2];
             $this->LOADER = strtolower($m[3]);
             $_SERVER['QUERY_STRING'] = preg_replace('/^&+|&+$/s', '', preg_replace('/(^|&)'.session_name().'=[^&]*&?/s', '&', $m[1] . $m[4]));