--- drupal-4.5.1/includes/common.inc Mon Nov 29 18:59:50 2004 +++ drupal-4.5.2/includes/common.inc Tue Dec 28 12:04:14 2004 @@ -1,5 +1,5 @@ > 6)) + . chr(0x80 | ($codepoint & 0x3F)); + } + else if ($codepoint < 0x10000) { + $str = chr(0xE0 | ( $codepoint >> 12)) + . chr(0x80 | (($codepoint >> 6) & 0x3F)) + . chr(0x80 | ( $codepoint & 0x3F)); + } + else if ($codepoint < 0x200000) { + $str = chr(0xF0 | ( $codepoint >> 18)) + . chr(0x80 | (($codepoint >> 12) & 0x3F)) + . chr(0x80 | (($codepoint >> 6) & 0x3F)) + . chr(0x80 | ( $codepoint & 0x3F)); + } + if (in_array($str, $exclude)) { + return $original; + } + else { + return $str; + } +} + +/** * Evaluate a string of PHP code. * * This is a wrapper around PHP's eval(). It uses output buffering to capture both @@ -1849,8 +1909,14 @@ // Initialize all enabled modules. module_init(); -if ($_REQUEST && !user_access('bypass input data check')) { - if (!valid_input_data($_REQUEST)) { +if (!user_access('bypass input data check')) { + // We can't use $_REQUEST because it consists of the contents of $_POST, + // $_GET and $_COOKIE: if any of the input arrays share a key, only one + // value will be verified. + if (!valid_input_data($_GET) + || !valid_input_data($_POST) + || !valid_input_data($_COOKIE) + || !valid_input_data($_FILES)) { die('Terminated request because of suspicious input data.'); } }