Avoid cyclic stub problems when authorization hooks do funny things with the user...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 4 May 2007 21:04:50 +0000 (21:04 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 4 May 2007 21:04:50 +0000 (21:04 +0000)
includes/Database.php

index ef18a6d..3fd6ad1 100644 (file)
@@ -709,7 +709,7 @@ class Database {
                # Add a comment for easy SHOW PROCESSLIST interpretation
                #if ( $fname ) {
                        global $wgUser;
-                       if ( is_object( $wgUser ) ) {
+                       if ( is_object( $wgUser ) && !($wgUser instanceof StubObject) ) {
                                $userName = $wgUser->getName();
                                if ( strlen( $userName ) > 15 ) {
                                        $userName = substr( $userName, 0, 15 ) . '...';