jenkins-bot has submitted this change and it was merged.

Change subject: Don't try to construct a Title object with anything other a 
string
......................................................................


Don't try to construct a Title object with anything other a string

Bug: T109976
Change-Id: I5be9cf67301ae61badef8f1628a839cb48cdf8f1
---
M includes/specials/SpecialMobileEditor.php
M includes/specials/SpecialMobileLanguages.php
2 files changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialMobileEditor.php 
b/includes/specials/SpecialMobileEditor.php
index de27686..feb519e 100644
--- a/includes/specials/SpecialMobileEditor.php
+++ b/includes/specials/SpecialMobileEditor.php
@@ -20,9 +20,7 @@
         * @param string $subpage The name of the page to edit
         */
        public function executeWhenAvailable( $subpage ) {
-               $title = Title::newFromText( $subpage );
-
-               if ( is_null( $title ) ) {
+               if ( !is_string( $subpage ) || is_null( $title = 
Title::newFromText( $subpage ) ) ) {
                        $this->showPageNotFound();
                        return;
                }
diff --git a/includes/specials/SpecialMobileLanguages.php 
b/includes/specials/SpecialMobileLanguages.php
index f6d25fb..8713c6e 100644
--- a/includes/specials/SpecialMobileLanguages.php
+++ b/includes/specials/SpecialMobileLanguages.php
@@ -128,7 +128,7 @@
         * @param string $pagename The name of the page
         */
        public function executeWhenAvailable( $pagename ) {
-               if ( $pagename === '' ) {
+               if ( !is_string( $pagename ) || $pagename === '' ) {
                        wfHttpError( 404, $this->msg( 
'mobile-frontend-languages-404-title' )->text(),
                                $this->msg( 
'mobile-frontend-languages-404-desc' )->text()
                        );

-- 
To view, visit https://gerrit.wikimedia.org/r/234031
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5be9cf67301ae61badef8f1628a839cb48cdf8f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to