Merge "Separate select() parameter summary from detail"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 50c3c7b..582f61e 100644 (file)
@@ -318,7 +318,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                // Paranoia: avoid brute force searches (bug 17342)
                                if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
                                        $bitmask = Revision::DELETED_USER;
-                               } elseif ( !$this->getUser()->isAllowed( 'suppressrevision' ) ) {
+                               } elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
                                        $bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
                                } else {
                                        $bitmask = 0;
@@ -624,10 +624,9 @@ class ApiQueryRevisions extends ApiQueryBase {
                }
 
                if ( $content && ( !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) ) {
-                       global $wgAPIMaxUncachedDiffs;
                        static $n = 0; // Number of uncached diffs we've had
 
-                       if ( $n < $wgAPIMaxUncachedDiffs ) {
+                       if ( $n < $this->getConfig()->get( 'APIMaxUncachedDiffs' ) ) {
                                $vals['diff'] = array();
                                $context = new DerivativeContext( $this->getContext() );
                                $context->setTitle( $title );