r111239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111238‎ | r111239 | r111240 >
Date:15:13, 11 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup r11120, wfParseUrl() can return false, if it does, the host isn't going to be valid
Modified paths:
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -47,8 +47,11 @@
4848 if ( !count( $wgCopyUploadsDomains ) ) {
4949 return true;
5050 }
 51+ $parsedUrl = wfParseUrl( $url );
 52+ if ( !$parsedUrl ) {
 53+ return false;
 54+ }
5155 $valid = false;
52 - $parsedUrl = wfParseUrl( $url );
5356 foreach( $wgCopyUploadsDomains as $domain ) {
5457 if ( $parsedUrl['host'] === $domain ) {
5558 $valid = true;

Past revisions this follows-up on

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

Comments

#Comment by Reedy (talk | contribs)   15:15, 11 February 2012

r111120 rather

Status & tagging log