X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fupload%2FUploadBase.php;h=5193a7f4239f5fa7b95fef28532bc19a70b50fe8;hb=c37d6549fdffc9b53485a25d9f820385ecd91a52;hp=30a85aec145018bd15b787f4069580671c486b63;hpb=094fd4bacd812e2d5044a188db0557ac6bb42679;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 30a85aec14..5193a7f423 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -61,9 +61,6 @@ abstract class UploadBase { const FILETYPE_MISSING = 8; const FILETYPE_BADTYPE = 9; const VERIFICATION_ERROR = 10; - - # HOOK_ABORTED is the new name of UPLOAD_VERIFICATION_ERROR - const UPLOAD_VERIFICATION_ERROR = 11; const HOOK_ABORTED = 11; const FILE_TOO_LARGE = 12; const WINDOWS_NONASCII_FILENAME = 13; @@ -1118,10 +1115,10 @@ abstract class UploadBase { '[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+|"(?>[\0-\x0c\x0e-\x21\x23-\x5b\x5d-\x7f]+|\\\\[\0-\x7f])*"))*(?:;base64)?'; + // @codingStandardsIgnoreEnd + if ( !preg_match( "!^data:\s*image/(gif|jpeg|jpg|png)$parameters,!i", $value ) ) { wfDebug( __METHOD__ . ": Found href to unwhitelisted data: uri " . "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" ); @@ -1492,7 +1492,7 @@ abstract class UploadBase { } } - return false; //No scripts detected + return false; // No scripts detected } /** @@ -1655,7 +1655,7 @@ abstract class UploadBase { $output = trim( $output ); if ( !$output ) { - $output = true; #if there's no output, return true + $output = true; # if there's no output, return true } elseif ( $msgPattern ) { $groups = array(); if ( preg_match( $msgPattern, $output, $groups ) ) {