From d4a0af097ee72437d7ccd6811dd13be7c0a9b352 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sun, 23 Aug 2015 16:22:07 +0100 Subject: [PATCH] Avoid passing anything but a string to Title::newFromText in UploadBase::getTitle Bug: T109974 Change-Id: I54d42bcdcb95cb5b6a09c1c3bdea8891a14a7fdb --- includes/upload/UploadBase.php | 6 ++++++ 1 file changed, 6 insertions(+) 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. */ -- 2.20.1