replace ereg(i) by preg_match since the former is deprecated since PHP 5.3
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 17 May 2009 13:54:58 +0000 (13:54 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 17 May 2009 13:54:58 +0000 (13:54 +0000)
includes/specials/SpecialUpload.php

index 232064d..317402d 100644 (file)
@@ -665,7 +665,7 @@ class UploadForm {
                                '</li>' . $dlink2;
 
                } elseif ( ( substr( $partname , 3, 3 ) == 'px-' || substr( $partname , 2, 3 ) == 'px-' )
-                       && ereg( "[0-9]{2}" , substr( $partname , 0, 2) ) )
+                       && preg_match( "/[0-9]{2}/" , substr( $partname , 0, 2 ) ) )
                {
                        # Check for filenames like 50px- or 180px-, these are mostly thumbnails
                        $nt_thb = Title::newFromText( substr( $partname , strpos( $partname , '-' ) +1 ) . '.' . $rawExtension );
@@ -1498,7 +1498,7 @@ wgUploadAutoFill = {$autofill};
                wfDebug("SpecialUpload::detectScript: checking for embedded scripts and HTML stuff\n");
 
                #check for HTML doctype
-               if (eregi("<!DOCTYPE *X?HTML",$chunk)) return true;
+               if ( preg_match( "/<!DOCTYPE *X?HTML/i", $chunk ) ) return true;
 
                /**
                * Internet Explorer for Windows performs some really stupid file type