X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2FJsHttpRequest.php;h=59d5b86edf168aeb34ffcd55a07543acd21a98bc;hb=aec1717f263bf767543afa6bd0cb960ce53e0a0d;hp=78b0b2ce7e88a28933f26eb5fcc2f75f542c591d;hpb=8ca0a1cca99669b1c924dc5daa1a581a3c3206a8;p=fa-stable.git diff --git a/includes/JsHttpRequest.php b/includes/JsHttpRequest.php index 78b0b2ce..59d5b86e 100644 --- a/includes/JsHttpRequest.php +++ b/includes/JsHttpRequest.php @@ -63,7 +63,7 @@ class JsHttpRequest * If an object is created WITHOUT an active AJAX query, it is simply marked as * non-active. Use statuc method isActive() to check. */ - function JsHttpRequest($enc) + function __construct($enc) { global $JsHttpRequest_Active; @@ -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); } @@ -266,12 +266,14 @@ class JsHttpRequest '_POST'=> $rawPost, ); foreach ($source as $dst=>$src) { - // First correct all 2-byte entities. - $s = preg_replace('/%(?!5B)(?!5D)([0-9a-f]{2})/si', '%u00\\1', $src); - // Now we can use standard parse_str() with no worry! - $data = null; - parse_str($s, $data); - $GLOBALS[$dst] = $this->_ucs2EntitiesDecode($data); + if ($src != NULL) { + // First correct all 2-byte entities. + $s = preg_replace('/%(?!5B)(?!5D)([0-9a-f]{2})/si', '%u00\\1', $src); + // Now we can use standard parse_str() with no worry! + $data = null; + parse_str($s, $data); + $GLOBALS[$dst] = $this->_ucs2EntitiesDecode($data); + } } $GLOBALS['HTTP_GET_VARS'] = $_GET; // deprecated vars $GLOBALS['HTTP_POST_VARS'] = $_POST;