Improve NoticeHandler::getVisibleNotices() implementation
authorMatthias Schmidt <gravatronics@live.com>
Sun, 1 Jun 2014 16:00:06 +0000 (18:00 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 1 Jun 2014 16:00:06 +0000 (18:00 +0200)
Closes #1729

wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php

index 91f3400adae3aed4d10cdc5067517f66377c94da..ed94eb6189a4566aa0807972f8771e21ed095f0c 100644 (file)
@@ -35,18 +35,16 @@ class NoticeHandler extends SingletonFactory {
        public function getVisibleNotices() {
                $notices = array();
                foreach ($this->notices as $notice) {
-                       $checkFailed = false;
+                       if ($notice->isDismissed()) continue;
+                       
                        $conditions = $notice->getConditions();
                        foreach ($conditions as $condition) {
                                if (!$condition->getObjectType()->getProcessor()->showContent($condition)) {
-                                       $checkFailed = true;
-                                       break;
+                                       continue 2;
                                }
                        }
                        
-                       if (!$checkFailed && !$notice->isDismissed()) {
-                               $notices[$notice->noticeID] = $notice;
-                       }
+                       $notices[$notice->noticeID] = $notice;
                }
                
                return $notices;