Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / api / ApiProtect.php
index 20b660a..286f191 100644 (file)
@@ -37,8 +37,8 @@ class ApiProtect extends ApiBase {
                global $wgRestrictionLevels;
                $params = $this->extractRequestParams();
 
-               $titleObj = $this->getTitleOrPageId( $params );
-               $pageObj = WikiPage::factory( $titleObj );
+               $pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
+               $titleObj = $pageObj->getTitle();
 
                $errors = $titleObj->getUserPermissionsErrors( 'protect', $this->getUser() );
                if ( $errors ) {