* no need to pass "$asyncdownload = false", this is not python :)
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 22 Jul 2009 19:42:02 +0000 (19:42 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 22 Jul 2009 19:42:02 +0000 (19:42 +0000)
* added new line at the end of wfDebug() call
* change ereg(i) to preg_match, the former is deprecated since PHP 5.3

includes/upload/UploadBase.php
includes/upload/UploadFromUrl.php

index d2f94ea..97cd198 100644 (file)
@@ -66,7 +66,7 @@ class UploadBase {
 
                $type = ucfirst( $type );
                $className = 'UploadFrom' . $type;
-               wfDebug( __METHOD__ . ": class name: $className" );
+               wfDebug( __METHOD__ . ": class name: $className\n" );
                if( !in_array( $type, self::$uploadHandlers ) )
                        return null;
 
@@ -638,7 +638,7 @@ class UploadBase {
                wfDebug( __METHOD__ . ": checking for embedded scripts and HTML stuff\n" );
 
                #check for HTML doctype
-               if( eregi( "<!DOCTYPE *X?HTML", $chunk ) )
+               if ( preg_match( "/<!DOCTYPE *X?HTML/i", $chunk ) )
                        return true;
 
                /**
@@ -951,7 +951,7 @@ class UploadBase {
                                        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 ) );
        }
 
        /**
index 4533ef9..8765a3b 100644 (file)
@@ -62,7 +62,7 @@ class UploadFromUrl extends UploadBase {
                return $this->initialize(
                        $desiredDestName,
                        $request->getVal( 'wpUploadFileURL' ),
-                       $asyncdownload = false
+                       false
                );
        }