X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Fcommon.php;h=4026d6073d37dd5448fb0946fa8c9e5d2f96f8fa;hb=640b8c0e60bb8a13dde241ec4d23ca1f58bb5b8a;hp=69b89ba876f93bfa67fa8410c6dbf1473ba63ca7;hpb=885d7355f6b00f4b7f931d4d50c0e7b31d29bb32;p=plcapi.git diff --git a/debugger/common.php b/debugger/common.php index 69b89ba..4026d60 100644 --- a/debugger/common.php +++ b/debugger/common.php @@ -2,7 +2,9 @@ /** * @author Gaetano Giunta * @copyright (C) 2005-2015 G. Giunta - * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt + * @license code licensed under the BSD License: see file license.txt + * + * Parses GET/POST variables * * @todo switch params for http compression from 0,1,2 to values to be used directly * @todo do some more sanitization of received parameters @@ -22,10 +24,15 @@ if (get_magic_quotes_gpc()) { $_GET = array_map('stripslashes_deep', $_GET); } +$preferredEncodings = 'UTF-8, ASCII, ISO-8859-1, UTF-7, EUC-JP, SJIS, eucJP-win, SJIS-win, JIS, ISO-2022-JP'; +$inputcharset = mb_detect_encoding(urldecode($_SERVER['REQUEST_URI']), $preferredEncodings); if (isset($_GET['usepost']) && $_GET['usepost'] === 'true') { $_GET = $_POST; + $inputcharset = mb_detect_encoding(implode('', $_GET), $preferredEncodings); } +/// @todo if $inputcharset is not UTF8, we should probably re-encode $_GET to make it UTF-8 + // recover input parameters $debug = false; $protocol = 0;