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
/**
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
wfDebug( "Query {$this->mDBname} ($cnt) ($master): $sqlx\n" );
}
- if ( istainted( $sql ) & TC_MYSQL ) {
- if ( !Profiler::instance()->isStub() ) {
- wfProfileOut( $queryProf );
- wfProfileOut( $totalProf );
- }
- throw new MWException( 'Tainted query found' );
- }
-
$queryId = MWDebug::query( $sql, $fname, $isMaster );
# Do the query and handle errors
return true;
}
- $lines = wfArrayMap( 'trim', explode( "\n", $lines ) );
+ $lines = array_map( 'trim', explode( "\n", $lines ) );
$candidatesByLocale = array();
$candidatesByLang = array();