Merge "Fix for missing end tag </page> on some exports"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 1 Nov 2018 03:03:24 +0000 (03:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 1 Nov 2018 03:03:24 +0000 (03:03 +0000)
includes/user/User.php

index 11cfd49..f0b2c57 100644 (file)
@@ -909,6 +909,8 @@ class User implements IDBAccessObject, UserIdentity {
         * @return int|null The corresponding user's ID, or null if user is nonexistent
         */
        public static function idFromName( $name, $flags = self::READ_NORMAL ) {
+               // Don't explode on self::$idCacheByName[$name] if $name is not a string but e.g. a User object
+               $name = (string)$name;
                $nt = Title::makeTitleSafe( NS_USER, $name );
                if ( is_null( $nt ) ) {
                        // Illegal name