SECURITY: RevDel: Check all revisions for suppression, not just the first
[lhc/web/wiklou.git] / includes / revisiondelete / RevDelList.php
index 7aac3b8..7ffb427 100644 (file)
@@ -73,6 +73,25 @@ abstract class RevDelList extends RevisionListBase {
                return $target;
        }
 
+       /**
+        * Indicate whether any item in this list is suppressed
+        * @since 1.25
+        * @return bool
+        */
+       public function areAnySuppressed() {
+               $bit = $this->getSuppressBit();
+
+               // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+               for ( $this->reset(); $this->current(); $this->next() ) {
+                       // @codingStandardsIgnoreEnd
+                       $item = $this->current();
+                       if ( $item->getBits() & $bit ) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
        /**
         * Set the visibility for the revisions in this list. Logging and
         * transactions are done here.