Add a real fetchFile() method.
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 26 Sep 2008 20:06:23 +0000 (20:06 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 26 Sep 2008 20:06:23 +0000 (20:06 +0000)
includes/UploadBase.php
includes/UploadFromUrl.php

index e137ee5..42fbe72 100644 (file)
@@ -75,6 +75,13 @@ class UploadBase {
                $this->mRemoveTempFile = $removeTempFile;
        }
 
+       /**
+        * Fetch the file. Usually a no-op
+        */
+       function fetchFile() {
+               return self::OK;
+       }
+
        function verifyUpload() {
                global $wgUser;
                
index b908032..7e23b8c 100644 (file)
@@ -20,7 +20,10 @@ class UploadFromUrl extends UploadBase {
                $this->mUrl = trim( $url );
        }
        
-       function verifyUpload() {
+       /**
+        * Do the real fetching stuff
+        */
+       function fetchFile() {
                if( stripos($this->mUrl, 'http://') !== 0 && stripos($this->mUrl, 'ftp://') !== 0 ) {
                        return array(
                                'status' => self::BEFORE_PROCESSING,
@@ -34,10 +37,10 @@ class UploadFromUrl extends UploadBase {
                                'error' => $res,
                        );
                }
-               return parent::verifyUpload();
+               return self::OK;
        }
        
-               /**
+       /**
         * Safe copy from URL
         * Returns true if there was an error, false otherwise
         */