66 && self::haveUndecodedRequestUri(
$vars[
'SERVER_SOFTWARE'] )
68 $urlPart =
$vars[
'REQUEST_URI'];
70 $urlPart =
$vars[
'QUERY_STRING'];
75 if ( self::isUrlExtensionBad( $urlPart, $extWhitelist ) ) {
82 && self::isUrlExtensionBad(
$vars[
'PATH_INFO'], $extWhitelist )
101 if (
strval( $urlPart ) ===
'' ) {
106 if (
strval( $extension ) ===
'' ) {
111 if (
in_array( $extension, [
'php',
'php5' ] ) ) {
115 if (
in_array( $extension, $extWhitelist ) ) {
120 if ( !
preg_match(
'/^[a-zA-Z0-9_-]+$/', $extension ) ) {
141 $questionPos =
strpos( $url,
'?' );
142 if ( $questionPos ===
false ) {
143 $beforeQuery = $url .
'?';
149 $beforeQuery =
substr( $url, 0, $questionPos + 1 );
160 $url = $beforeQuery .
$query;
161 if ( self::isUrlExtensionBad( $url, $extWhitelist ) ) {
194 $hashPos =
strpos( $url,
'#' );
195 if ( $hashPos !==
false ) {
198 $urlLength =
strlen( $url );
201 while ( $remainingLength > 0 ) {
203 $pos +=
strcspn( $url,
'.', $pos, $remainingLength );
204 if ( $pos >= $urlLength ) {
211 $remainingLength = $urlLength - $pos;
215 $nextPos = $pos +
strcspn( $url,
"<>\\\"/:|?*.", $pos, $remainingLength );
216 if ( $nextPos >= $urlLength ) {
219 return substr( $url, $pos, $urlLength - $pos );
221 if ( $url[$nextPos] ===
'?' ) {
224 $extension =
substr( $url, $pos, $nextPos - $pos );
235 $remainingLength = $urlLength - $pos;
258 static $whitelist = [
262 if (
preg_match(
'/^(.*?)($|\/| )/', $serverSoftware, $m ) ) {
263 return in_array( $m[1], $whitelist );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Internet Explorer derives a cache filename from a URL, and then in certain circumstances,...
static areServerVarsBad( $vars, $extWhitelist=[])
Check a subset of $_SERVER (or the whole of $_SERVER if you like) to see if it indicates that the req...
static haveUndecodedRequestUri( $serverSoftware)
When passed the value of $_SERVER['SERVER_SOFTWARE'], this function returns true if that server is kn...
static findIE6Extension( $url)
Determine what extension IE6 will infer from a certain query string.
static isUrlExtensionBad( $urlPart, $extWhitelist=[])
Given a right-hand portion of a URL, determine whether IE would detect a potentially harmful file ext...
static fixUrlForIE6( $url, $extWhitelist=[])
Returns a variant of $url which will pass isUrlExtensionBad() but has the same GET parameters,...
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query