From: Alex Monk Date: Sun, 23 Aug 2015 15:22:07 +0000 (+0100) Subject: Avoid passing anything but a string to Title::newFromText in UploadBase::getTitle X-Git-Tag: 1.31.0-rc.0~10159^2 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=d4a0af097ee72437d7ccd6811dd13be7c0a9b352;p=lhc%2Fweb%2Fwiklou.git Avoid passing anything but a string to Title::newFromText in UploadBase::getTitle Bug: T109974 Change-Id: I54d42bcdcb95cb5b6a09c1c3bdea8891a14a7fdb --- diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 493df2e29b..b06b91e4a7 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -752,6 +752,12 @@ abstract class UploadBase { if ( $this->mTitle !== false ) { return $this->mTitle; } + if ( !is_string( $this->mDesiredDestName ) ) { + $this->mTitleError = self::ILLEGAL_FILENAME; + $this->mTitle = null; + + return $this->mTitle; + } /* Assume that if a user specified File:Something.jpg, this is an error * and that the namespace prefix needs to be stripped of. */