X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Fcommon.php;h=4026d6073d37dd5448fb0946fa8c9e5d2f96f8fa;hb=238968291ce5627e94dbc3928d377d09f6e9eeda;hp=e8ad64cc0380ffe42507200aa56f352d18a36582;hpb=c8a412d48733f671db6ba149659b816c2e14fd3a;p=plcapi.git diff --git a/debugger/common.php b/debugger/common.php index e8ad64c..4026d60 100644 --- a/debugger/common.php +++ b/debugger/common.php @@ -24,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;