Converted User to use lazy initialisation. This is to avoid unstub loops, and also...
[lhc/web/wiklou.git] / maintenance / importImages.php
index 2cf8bd1..abf0ec0 100644 (file)
@@ -30,7 +30,9 @@ if( count( $args ) > 1 ) {
                $wgUser = User::newFromName( $options['user'] );
        } else {
                $wgUser = User::newFromName( 'Image import script' );
-               $wgUser->setLoaded( true );
+       }
+       if ( $wgUser->isAnon() ) {
+               $wgUser->addToDatabase();
        }
        
        # Get the upload comment
@@ -119,4 +121,4 @@ END;
        exit();
 }
 
-?>
\ No newline at end of file
+?>