From: Brian Wolff Date: Fri, 4 Mar 2011 22:21:48 +0000 (+0000) Subject: trim the upload_by_url field from upload form, since if you have an extra space at... X-Git-Tag: 1.31.0-rc.0~31646 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=6f7958499a3d727c8c83e9d594712a6e30cd05e9;p=lhc%2Fweb%2Fwiklou.git 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. --- 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 ); }