r94601 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94600‎ | r94601 | r94602 >
Date:05:37, 16 August 2011
Author:bawolff
Status:ok
Tags:
Comment:
follow-up r88171 - fix fatal if suggested filename has illegal character in it.

Check to make sure the title object actual exists, before checking its namespace,
since alll the does this have illegal chars check is done after the does it
start with file: check.

For future note though, when using upload by url feature, the suggested
destination name when you put http://upload.wikimedia.org/wikipedia/commons/e/e0/Petrorhagia_prolifera_%281%29.JPG is illegal, which is probably not very user-friendly (filed as bug 30390)
Modified paths:
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadBase.php
@@ -611,7 +611,7 @@
612612 * and that the namespace prefix needs to be stripped of.
613613 */
614614 $title = Title::newFromText( $this->mDesiredDestName );
615 - if ( $title->getNamespace() == NS_FILE ) {
 615+ if ( $title && $title->getNamespace() == NS_FILE ) {
616616 $this->mFilteredName = $title->getDBkey();
617617 } else {
618618 $this->mFilteredName = $this->mDesiredDestName;

Follow-up revisions

RevisionCommit summaryAuthorDate
r94728follow-up r94601 - add unit tests for stripping the File: prefix from upload,...bawolff04:05, 17 August 2011
r95607MFT to REL1_18...hashar19:28, 27 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88171(bug 23464) File: prefixes are now chopped off during uploading.btongminh12:51, 15 May 2011

Status & tagging log