X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2FJsHttpRequest.php;h=f71c0ed236075c0bd5a53cf1e3f145718d3f1fcf;hb=95b0f12c88c15a89e6d73f8f02ec2cd042167bed;hp=12dbf686aea7bb383e731aab6cc2a3c2fdff2724;hpb=8864b1ec0fd3321e510511ef22614bc36845540e;p=fa-stable.git diff --git a/includes/JsHttpRequest.php b/includes/JsHttpRequest.php index 12dbf686..f71c0ed2 100644 --- a/includes/JsHttpRequest.php +++ b/includes/JsHttpRequest.php @@ -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])); @@ -187,7 +187,7 @@ class JsHttpRequest if ($this->SCRIPT_DECODE_MODE == 'entities') return str_replace(array('"', '<', '>'), array('"', '<', '>'), $s); else - return htmlspecialchars($s); + return html_specials_encode($s); } @@ -230,12 +230,12 @@ class JsHttpRequest $result = array(); if ($isList) { foreach ($a as $v) { - $result[] = JsHttpRequest::php2js($v); + $result[] = $this->php2js($v); } return '[ ' . join(', ', $result) . ' ]'; } else { foreach ($a as $k => $v) { - $result[] = JsHttpRequest::php2js($k) . ': ' . JsHttpRequest::php2js($v); + $result[] = $this->php2js($k) . ': ' . $this->php2js($v); } return '{ ' . join(', ', $result) . ' }'; }