Legoktm has uploaded a new change for review.

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

Change subject: ImageListPager: Fix improper use of Title::newFromText().
......................................................................

ImageListPager: Fix improper use of Title::newFromText().

The $defaultNamespace parameter to Title::newFromText() only applies if
a namespace prefix isn't included in the text. So if a username was
"Help:FooBar", the NS_USER prefix would not be applied.

Instead use Title::makeTitleSafe( NS_USER, ... ); which was designed for
this specific purpose.

Change-Id: Iafce73d352887947e61ae7c906ddf965e04fbf6f
---
M includes/specials/pagers/ImageListPager.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/281732/1

diff --git a/includes/specials/pagers/ImageListPager.php 
b/includes/specials/pagers/ImageListPager.php
index 48f60ca..258ac83 100644
--- a/includes/specials/pagers/ImageListPager.php
+++ b/includes/specials/pagers/ImageListPager.php
@@ -54,7 +54,7 @@
                $this->mShowAll = $showAll;
 
                if ( $userName !== null && $userName !== '' ) {
-                       $nt = Title::newFromText( $userName, NS_USER );
+                       $nt = Title::makeTitleSafe( NS_USER, $userName );
                        if ( is_null( $nt ) ) {
                                $this->outputUserDoesNotExist( $userName );
                        } else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafce73d352887947e61ae7c906ddf965e04fbf6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to