MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/57936


Change subject: Handle invalid titles on ProtectedPages and ProtectedTitles
......................................................................

Handle invalid titles on ProtectedPages and ProtectedTitles

bug: 46493
Change-Id: Iaa6e3378c185c53b77a4ede0ddfdfed8c6a2268a
(cherry picked from commit 19ecb69fbc2506568edbcf87cff110441bf90813)
---
M includes/specials/SpecialProtectedpages.php
M includes/specials/SpecialProtectedtitles.php
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/57936/1

diff --git a/includes/specials/SpecialProtectedpages.php 
b/includes/specials/SpecialProtectedpages.php
index eb89bec..cdf053e 100644
--- a/includes/specials/SpecialProtectedpages.php
+++ b/includes/specials/SpecialProtectedpages.php
@@ -83,6 +83,12 @@
                }
 
                $title = Title::makeTitleSafe( $row->page_namespace, 
$row->page_title );
+               if( !$title ) {
+                       return Html::rawElement( 'li', array(),
+                               Html::element( 'span', array( 'class' => 
'mw-invalidtitle' ),
+                                       Linker::getInvalidTitleDescription( 
$this->getContext(), $row->page_namespace, $row->page_title ) ) ) . "\n";
+               }
+
                $link = Linker::link( $title );
 
                $description_items = array ();
diff --git a/includes/specials/SpecialProtectedtitles.php 
b/includes/specials/SpecialProtectedtitles.php
index 6a94deb..0cba5eb 100644
--- a/includes/specials/SpecialProtectedtitles.php
+++ b/includes/specials/SpecialProtectedtitles.php
@@ -81,6 +81,12 @@
                }
 
                $title = Title::makeTitleSafe( $row->pt_namespace, 
$row->pt_title );
+               if( !$title ) {
+                       return Html::rawElement( 'li', array(),
+                               Html::element( 'span', array( 'class' => 
'mw-invalidtitle' ),
+                                       Linker::getInvalidTitleDescription( 
$this->getContext(), $row->pt_namespace, $row->pt_title ) ) ) . "\n";
+               }
+
                $link = Linker::link( $title );
 
                $description_items = array ();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa6e3378c185c53b77a4ede0ddfdfed8c6a2268a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_21
Gerrit-Owner: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>

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

Reply via email to