Merge "(bug 47070) check content model namespace on import."
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index d9aacaa..eb51095 100644 (file)
@@ -493,7 +493,7 @@ abstract class ApiQueryBase extends ApiBase {
                if ( !$t ) {
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
-               if ( $defaultNamespace != $t->getNamespace() || $t->getInterwiki() !== '' ) {
+               if ( $defaultNamespace != $t->getNamespace() || $t->isExternal() ) {
                        // This can happen in two cases. First, if you call titlePartToKey with a title part
                        // that looks like a namespace, but with $defaultNamespace = NS_MAIN. It would be very
                        // difficult to handle such a case. Such cases cannot exist and are therefore treated
@@ -608,6 +608,15 @@ abstract class ApiQueryBase extends ApiBase {
 
                return $errors;
        }
+
+       /**
+        * Check whether the current user has permission to view revision-deleted
+        * fields.
+        * @return bool
+        */
+       public function userCanSeeRevDel() {
+               return $this->getUser()->isAllowedAny( 'deletedhistory', 'deletedtext', 'suppressrevision' );
+       }
 }
 
 /**