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

Change subject: Avoid passing non-strings into User::getCanonicalName
......................................................................


Avoid passing non-strings into User::getCanonicalName

Bug: T109973
Change-Id: I2c6766e3da3128a09535b72f7f78dc32854350e4
---
M includes/CentralAuthHooks.php
1 file changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index f67f5f9..9859689 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -2129,9 +2129,12 @@
         */
        public static function onSpecialLogAddLogSearchRelations( $type, 
WebRequest $request, array &$qc ) {
                if ( $type === 'gblrename' ) {
-                       $oldname = User::getCanonicalName( $request->getVal( 
'oldname' ) );
-                       if ( $oldname !== false ) {
-                               $qc = array( 'ls_field' => 'oldname', 
'ls_value' => $oldname );
+                       $oldname = $request->getVal( 'oldname' );
+                       if ( is_string( $oldname ) ) {
+                               $canonicalOldname = User::getCanonicalName( 
$oldname );
+                               if ( $oldname !== false ) {
+                                       $qc = array( 'ls_field' => 'oldname', 
'ls_value' => $canonicalOldname );
+                               }
                        }
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c6766e3da3128a09535b72f7f78dc32854350e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to