From 3243bcb79d3085a8b8c8e5e7546ea1581b0c7b78 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 1 Jun 2014 18:00:06 +0200 Subject: [PATCH] Improve NoticeHandler::getVisibleNotices() implementation Closes #1729 --- .../files/lib/system/notice/NoticeHandler.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php b/wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php index 91f3400ada..ed94eb6189 100644 --- a/wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php +++ b/wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php @@ -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; -- 2.20.1