r41292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41291‎ | r41292 | r41293 >
Date:20:06, 26 September 2008
Author:btongminh
Status:old
Tags:
Comment:
Add a real fetchFile() method.
Modified paths:
  • /trunk/phase3/includes/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UploadFromUrl.php
@@ -20,7 +20,10 @@
2121 $this->mUrl = trim( $url );
2222 }
2323
24 - function verifyUpload() {
 24+ /**
 25+ * Do the real fetching stuff
 26+ */
 27+ function fetchFile() {
2528 if( stripos($this->mUrl, 'http://') !== 0 && stripos($this->mUrl, 'ftp://') !== 0 ) {
2629 return array(
2730 'status' => self::BEFORE_PROCESSING,
@@ -34,10 +37,10 @@
3538 'error' => $res,
3639 );
3740 }
38 - return parent::verifyUpload();
 41+ return self::OK;
3942 }
4043
41 - /**
 44+ /**
4245 * Safe copy from URL
4346 * Returns true if there was an error, false otherwise
4447 */
Index: trunk/phase3/includes/UploadBase.php
@@ -75,6 +75,13 @@
7676 $this->mRemoveTempFile = $removeTempFile;
7777 }
7878
 79+ /**
 80+ * Fetch the file. Usually a no-op
 81+ */
 82+ function fetchFile() {
 83+ return self::OK;
 84+ }
 85+
7986 function verifyUpload() {
8087 global $wgUser;
8188