trim the upload_by_url field from upload form, since if you have an extra space at...
authorBrian Wolff <bawolff@users.mediawiki.org>
Fri, 4 Mar 2011 22:21:48 +0000 (22:21 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Fri, 4 Mar 2011 22:21:48 +0000 (22:21 +0000)
did when copying and pasting a url, gives a really misleading error message.

RELEASE-NOTES
includes/upload/UploadFromUrl.php

index c5ff319..513e299 100644 (file)
@@ -157,6 +157,8 @@ PHP if you have not done so prior to upgrading MediaWiki.
   exist.
 * (bug 27763) Article::getParserOutput() no longer throws a fatal given when an
   incorrect revision ID is passed.
+* Trim the form field for uploading by url to remove extra spaces which could
+  cause confusing error messages.
 
 === API changes in 1.18 ===
 * (bug 26339) Throw warning when truncating an overlarge API result
index c65dcb7..f696f18 100644 (file)
@@ -68,7 +68,7 @@ class UploadFromUrl extends UploadBase {
                        $desiredDestName = $request->getText( 'wpUploadFileURL' );
                return $this->initialize(
                        $desiredDestName,
-                       $request->getVal( 'wpUploadFileURL' ),
+                       trim( $request->getVal( 'wpUploadFileURL' ) ),
                        false
                );
        }