From: Kunal Mehta Date: Thu, 29 Sep 2016 23:09:43 +0000 (-0700) Subject: MovePage: Check ContentHandler::canBeUsedOn() X-Git-Tag: 1.31.0-rc.0~5267 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=f9b54ea8434a8c57f3db9fcb921b167ae85dbf1b;p=lhc%2Fweb%2Fwiklou.git MovePage: Check ContentHandler::canBeUsedOn() If the old content model cannot be used on the new page title, the page move should be disallowed. Change-Id: I6078a4cde5a76a050dddedf59634d800765cbabf --- diff --git a/includes/MovePage.php b/includes/MovePage.php index 5f1dd3fdf6..8ee562a309 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -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