From 6f7958499a3d727c8c83e9d594712a6e30cd05e9 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 4 Mar 2011 22:21:48 +0000 Subject: [PATCH] trim the upload_by_url field from upload form, since if you have an extra space at the beggining like I did when copying and pasting a url, gives a really misleading error message. --- RELEASE-NOTES | 2 ++ includes/upload/UploadFromUrl.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c5ff31984e..513e299553 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index c65dcb7750..f696f1872f 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -68,7 +68,7 @@ class UploadFromUrl extends UploadBase { $desiredDestName = $request->getText( 'wpUploadFileURL' ); return $this->initialize( $desiredDestName, - $request->getVal( 'wpUploadFileURL' ), + trim( $request->getVal( 'wpUploadFileURL' ) ), false ); } -- 2.20.1