Merge "Revert "Use display name in category page subheadings if provided""
[lhc/web/wiklou.git] / includes / MovePage.php
index 5f1dd3f..a8f6f8e 100644 (file)
@@ -131,6 +131,14 @@ class MovePage {
                                ContentHandler::getLocalizedName( $this->oldTitle->getContentModel() ),
                                ContentHandler::getLocalizedName( $this->newTitle->getContentModel() )
                        );
+               } elseif (
+                       !ContentHandler::getForTitle( $this->oldTitle )->canBeUsedOn( $this->newTitle )
+               ) {
+                       $status->fatal(
+                               'content-not-allowed-here',
+                               ContentHandler::getLocalizedName( $this->oldTitle->getContentModel() ),
+                               $this->newTitle->getPrefixedText()
+                       );
                }
 
                // Image-specific checks
@@ -531,8 +539,8 @@ class MovePage {
                        __METHOD__
                );
 
-               // clean up the old title before reset article id - bug 45348
                if ( !$redirectContent ) {
+                       // Clean up the old title *before* reset article id - bug 45348
                        WikiPage::onArticleDelete( $this->oldTitle );
                }