X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=1c6f642a1ecfdc0d10efe1bd059d21ecd01591ea;hb=fda090a7e7f85f146ec84798fda45232ab67613e;hp=51c67a63156e460d9513aff980a02923b22b9430;hpb=9d37b40d48c7aa598950de63eb51ffafe93d4888;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 51c67a6315..1c6f642a1e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -93,26 +93,6 @@ if ( !function_exists( 'mb_strrpos' ) ) { return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding ); } } - -// Support for Wietse Venema's taint feature -if ( !function_exists( 'istainted' ) ) { - /** - * @codeCoverageIgnore - * @return int - */ - function istainted( $var ) { - return 0; - } - /** @codeCoverageIgnore */ - function taint( $var, $level = 0 ) {} - /** @codeCoverageIgnore */ - function untaint( $var, $level = 0 ) {} - define( 'TC_HTML', 1 ); - define( 'TC_SHELL', 1 ); - define( 'TC_MYSQL', 1 ); - define( 'TC_PCRE', 1 ); - define( 'TC_SELF', 1 ); -} /// @endcond /** @@ -276,24 +256,6 @@ function wfObjectToArray( $objOrArray, $recursive = true ) { return $array; } -/** - * Wrapper around array_map() which also taints variables - * - * @param $function Callback - * @param $input Array - * @return Array - */ -function wfArrayMap( $function, $input ) { - $ret = array_map( $function, $input ); - foreach ( $ret as $key => $value ) { - $taint = istainted( $input[$key] ); - if ( $taint ) { - taint( $ret[$key], $taint ); - } - } - return $ret; -} - /** * Get a random decimal value between 0 and 1, in a way * not likely to give duplicate values for any realistic @@ -1712,7 +1674,7 @@ function wfMsgExt( $key, $options ) { /** * Since wfMsg() and co suck, they don't return false if the message key they - * looked up didn't exist but a XHTML string, this function checks for the + * looked up didn't exist but instead the key wrapped in <>'s, this function checks for the * nonexistence of messages by checking the MessageCache::get() result directly. * * @deprecated since 1.18. Use Message::isDisabled(). @@ -2631,11 +2593,11 @@ function in_string( $needle, $str, $insensitive = false ) { * @return Bool */ function wfIniGetBool( $setting ) { - $val = ini_get( $setting ); + $val = strtolower( ini_get( $setting ) ); // 'on' and 'true' can't have whitespace around them, but '1' can. - return strtolower( $val ) == 'on' - || strtolower( $val ) == 'true' - || strtolower( $val ) == 'yes' + return $val == 'on' + || $val == 'true' + || $val == 'yes' || preg_match( "/^\s*[+-]?0*[1-9]/", $val ); // approx C atoi() function }