Revert r45821, r45830, r45831 and r45835 all in order to revert r45819, per discussio...
[lhc/web/wiklou.git] / maintenance / importTextFile.php
index a1bb389..0a0068d 100644 (file)
@@ -4,7 +4,8 @@
  * Maintenance script allows creating or editing pages using
  * the contents of a text file
  *
- * @addtogroup Maintenance
+ * @file
+ * @ingroup Maintenance
  * @author Rob Church <robchur@gmail.com>
  */
 
@@ -23,22 +24,21 @@ if( count( $args ) < 1 || isset( $options['help'] ) ) {
                
                $title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
                $title = Title::newFromUrl( $title );
-               echo( "\nUsing title '" . $title->getPrefixedText() . "'..." );
                
                if( is_object( $title ) ) {
                        
+                       echo( "\nUsing title '" . $title->getPrefixedText() . "'..." );
                        if( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
                        
                                $text = file_get_contents( $filename );
                                $user = isset( $options['user'] ) ? $options['user'] : 'Maintenance script';
                                $user = User::newFromName( $user );
-                               echo( "\nUsing username '" . $user->getName() . "'..." );
                                
                                if( is_object( $user ) ) {
                                
+                                       echo( "\nUsing username '" . $user->getName() . "'..." );
                                        $wgUser =& $user;
                                        $comment = isset( $options['comment'] ) ? $options['comment'] : 'Importing text file';
-                                       $comment = str_replace( '_', ' ', $comment );
                                        $flags = 0 | ( isset( $options['norc'] ) ? EDIT_SUPPRESS_RC : 0 );
                                        
                                        echo( "\nPerforming edit..." );
@@ -84,4 +84,3 @@ function showHelp() {
        echo( "\n" );
 }
 
-?>
\ No newline at end of file