* Don't allow to import a page in the Media: namespace, this didn't work just because...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 6 Jan 2012 12:06:13 +0000 (12:06 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 6 Jan 2012 12:06:13 +0000 (12:06 +0000)
* Added localised message when trying to import a page with an interwiki prefix

includes/Import.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index bc02669..c79b963 100644 (file)
@@ -782,8 +782,11 @@ class WikiImporter {
                        # Invalid page title? Ignore the page
                        $this->notice( "Skipping invalid page title '$workTitle'" );
                        return false;
-               } elseif( $title->getInterwiki() != '' ) {
-                       $this->notice( "Skipping interwiki page title '$workTitle'" );
+               } elseif( $title->isExternal() ) {
+                       $this->notice( wfMessage( 'import-error-interwiki', $title->getText() )->text() );
+                       return false;
+               } elseif( !$title->canExist() ) {
+                       $this->notice( wfMessage( 'import-error-special', $title->getText() )->text() );
                        return false;
                } elseif( !$title->userCan( 'edit' ) && !$wgCommandLineMode ) {
                        # Do not import if the importing wiki user cannot edit this page
index 2fe09fa..b9963b6 100644 (file)
@@ -3398,6 +3398,8 @@ Please try again.',
 'import-invalid-interwiki'   => 'Cannot import from the specified wiki.',
 'import-error-edit'          => 'Page "$1" is not imported because you are not allowed to edit it.',
 'import-error-create'        => 'Page "$1" is not imported because you are not allowed to create it.',
+'import-error-interwiki'     => 'Page "$1" is not imported because its name is reserved for external linking (interwiki).',
+'import-error-special'       => 'Page "$1" is not imported because it belongs to a special namespace that does not allow pages.',
 
 # Import log
 'importlogpage'                    => 'Import log',
index 3ee01b6..3d1f403 100644 (file)
@@ -2353,6 +2353,8 @@ $wgMessageStructure = array(
                'import-invalid-interwiki',
                'import-error-edit',
                'import-error-create',
+               'import-error-interwiki',
+               'import-error-special',
        ),
        'importlog' => array(
                'importlogpage',