r109741 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109740‎ | r109741 | r109742 >
Date:17:33, 22 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Revert feature out of r109562, r109564, r109570

Leaving typo/brace fixes and other minor code improvements
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1344,7 +1344,6 @@
13451345 'upload-too-many-redirects',
13461346 'upload-unknown-size',
13471347 'upload-http-error',
1348 - 'upload-copy-upload-invalid-domain',
13491348 ),
13501349
13511350 'filebackend-errors' => array(
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -123,7 +123,6 @@
124124 * (bug 29309) Allow CSS class per tooltip (tipsy).
125125 * (bug 33565) Add accesskey/tooltip to submit buttons on Special:EditWatchlist.
126126 * (bug 17959) Inline rendering/thumbnailing for Gimp XCF images.
127 -* (bug 32341) Add upload by URL domain limitation.
128127
129128 === Bug fixes in 1.19 ===
130129 * $wgUploadNavigationUrl should be used for file redlinks if.
Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -38,28 +38,6 @@
3939 }
4040
4141 /**
42 - * Checks whether the URL is for an allowed host
43 - *
44 - * @param $url string
45 - * @return bool
46 - */
47 - public static function isAllowedHost( $url ) {
48 - global $wgCopyUploadsDomains;
49 - if ( !count( $wgCopyUploadsDomains ) ) {
50 - return true;
51 - }
52 - $valid = false;
53 - $parsedUrl = wfParseUrl( $url );
54 - foreach( $wgCopyUploadsDomains as $domain ) {
55 - if ( $parsedUrl['host'] === $domain ) {
56 - $valid = true;
57 - break;
58 - }
59 - }
60 - return $valid;
61 - }
62 -
63 - /**
6442 * Entry point for API upload
6543 *
6644 * @param $name string
@@ -124,9 +102,6 @@
125103 return Status::newFatal( 'http-invalid-url' );
126104 }
127105
128 - if( !self::isAllowedHost( $this->mUrl ) ) {
129 - return Status::newFatal( 'upload-copy-upload-invalid-domain' );
130 - }
131106 if ( !$this->mAsync ) {
132107 return $this->reallyFetchFile();
133108 }
Index: trunk/phase3/includes/api/ApiBase.php
@@ -1231,7 +1231,6 @@
12321232 'nouploadmodule' => array( 'code' => 'nouploadmodule', 'info' => 'No upload module set' ),
12331233 'uploaddisabled' => array( 'code' => 'uploaddisabled', 'info' => 'Uploads are not enabled. Make sure $wgEnableUploads is set to true in LocalSettings.php and the PHP ini setting file_uploads is true' ),
12341234 'copyuploaddisabled' => array( 'code' => 'copyuploaddisabled', 'info' => 'Uploads by URL is not enabled. Make sure $wgAllowCopyUploads is set to true in LocalSettings.php.' ),
1235 - 'copyuploadbaddomain' => array( 'code' => 'copyuploadbaddomain', 'info' => 'Uploads by URL are not allowed from this domain.' ),
12361235
12371236 'filename-tooshort' => array( 'code' => 'filename-tooshort', 'info' => 'The filename is too short' ),
12381237 'filename-toolong' => array( 'code' => 'filename-toolong', 'info' => 'The filename is too long' ),
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -318,10 +318,6 @@
319319 $this->dieUsageMsg( 'copyuploaddisabled' );
320320 }
321321
322 - if ( !UploadFromUrl::isAllowedHost( $this->mParams['url'] ) ) {
323 - $this->dieUsageMsg( 'copyuploadbaddomain' );
324 - }
325 -
326322 $async = false;
327323 if ( $this->mParams['asyncdownload'] ) {
328324 $this->checkAsyncDownloadEnabled();
Index: trunk/phase3/includes/DefaultSettings.php
@@ -453,10 +453,6 @@
454454 * This feature is experimental and broken as of r81612.
455455 */
456456 $wgAllowAsyncCopyUploads = false;
457 -/**
458 - * A list of domains copy uploads can come from
459 - */
460 -$wgCopyUploadsDomains = array();
461457
462458 /**
463459 * Max size for uploads, in bytes. If not set to an array, applies to all
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2235,7 +2235,6 @@
22362236 'upload-too-many-redirects' => 'The URL contained too many redirects',
22372237 'upload-unknown-size' => 'Unknown size',
22382238 'upload-http-error' => 'An HTTP error occured: $1',
2239 -'upload-copy-upload-invalid-domain' => 'Copy uploads are not available from this domain.',
22402239
22412240 # File backend
22422241 'backend-fail-stream' => 'Could not stream file $1.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r111120* (bug 32341) Add upload by URL domain limitation....reedy23:22, 9 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109562* (bug 32341) Add upload by URL domain limitation.reedy19:16, 19 January 2012
r109564Followup r109562...reedy20:26, 19 January 2012
r109570r109562: Register new message key for maintenance scriptraymond21:12, 19 January 2012

Status & tagging log