MusikAnimal has uploaded a new change for review.

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

Change subject: Normalize page titles in list=projectpages response
......................................................................

Normalize page titles in list=projectpages response

Bug T137172

Change-Id: Ia237aa91bb2bd41392444a7d0412dcabf0546bd1
---
M api/ApiQueryProjectPages.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageAssessments 
refs/changes/53/293253/1

diff --git a/api/ApiQueryProjectPages.php b/api/ApiQueryProjectPages.php
index edb44a5..51bd240 100644
--- a/api/ApiQueryProjectPages.php
+++ b/api/ApiQueryProjectPages.php
@@ -169,10 +169,13 @@
        }
 
        private function generateResultVals( $row ) {
+               // fallback to row title if Title class considers it illegal
+               $title = Title::newFromText( $row->title ) ?: $row->title;
+
                $vals = array(
                        'pageid' => (int)$row->page_id,
                        'ns' => (int)$row->namespace,
-                       'title' => $row->title,
+                       'title' => $title,
                );
 
                if ( isset( $row->class ) && isset( $row->importance ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia237aa91bb2bd41392444a7d0412dcabf0546bd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: MusikAnimal <musikani...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to