Ori.livneh has uploaded a new change for review.

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

Change subject: Avoid calling Title::makeTitleSafe in User::idFromName
......................................................................

Avoid calling Title::makeTitleSafe in User::idFromName

We don't want to call Title::makeTitleSafe yet, since that call path
ends up needing the user language, which ends up trying to load the
user object, which ends up back in User::idFromName.

Bug: 54193
Change-Id: I05aacd30be66fe505b5c211113ea938fa82e2492
---
M includes/User.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/174051/1

diff --git a/includes/User.php b/includes/User.php
index 8fcdab2..5987c1f 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -565,7 +565,10 @@
         * @return int|null The corresponding user's ID, or null if user is 
nonexistent
         */
        public static function idFromName( $name ) {
-               $nt = Title::makeTitleSafe( NS_USER, $name );
+               // We don't want to call Title::makeTitleSafe yet, since that 
call path
+               // ends up needing the user language, which ends up trying to 
load the
+               // user object, which ends up back here (bug 54193).
+               $nt = Title::makeTitle( NS_USER, $name );
                if ( is_null( $nt ) ) {
                        // Illegal name
                        return null;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05aacd30be66fe505b5c211113ea938fa82e2492
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to