Introducing ContentGetParserOutput hook.
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 51c67a6..1c6f642 100644 (file)
@@ -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
 }