Patch for 3592: unnecessary instantiation of User
authorTom Gilder <tomgilder@users.mediawiki.org>
Thu, 6 Oct 2005 23:16:28 +0000 (23:16 +0000)
committerTom Gilder <tomgilder@users.mediawiki.org>
Thu, 6 Oct 2005 23:16:28 +0000 (23:16 +0000)
includes/User.php

index dada941..2aea2e9 100644 (file)
@@ -50,8 +50,6 @@ class User {
         * @static
         */
        function newFromName( $name ) {
-               $u = new User();
-
                # Force usernames to capital
                global $wgContLang;
                $name = $wgContLang->ucfirst( $name );
@@ -71,6 +69,7 @@ class User {
                        return null;
                }
 
+               $u = new User();
                $u->setName( $canonicalName );
                $u->setId( $u->idFromName( $canonicalName ) );
                return $u;