Merge "Fix wording of protect-cascadeon"
[lhc/web/wiklou.git] / maintenance / importTextFile.php
index 0c4f98c..c7df6c3 100644 (file)
@@ -24,7 +24,7 @@
 
 $options = array( 'help', 'nooverwrite', 'norc' );
 $optionsWithArgs = array( 'title', 'user', 'comment' );
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
 echo "Import Text File\n\n";
 
 if ( count( $args ) < 1 || isset( $options['help'] ) ) {
@@ -36,12 +36,13 @@ if ( count( $args ) < 1 || isset( $options['help'] ) ) {
        if ( is_file( $filename ) ) {
 
                $title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
-               $title = Title::newFromURL( $title );
+               $title = Title::newFromText( $title );
 
                if ( is_object( $title ) ) {
 
                        echo "\nUsing title '" . $title->getPrefixedText() . "'...";
                        if ( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
+                               RequestContext::getMain()->setTitle( $title );
 
                                $text = file_get_contents( $filename );
                                $user = isset( $options['user'] ) ? $options['user'] : 'Maintenance script';