From: Matthias Schmidt Date: Sun, 1 Jun 2014 16:00:06 +0000 (+0200) Subject: Improve NoticeHandler::getVisibleNotices() implementation X-Git-Tag: 2.1.0_Alpha_1~763 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3243bcb79d3085a8b8c8e5e7546ea1581b0c7b78;p=GitHub%2FWoltLab%2FWCF.git Improve NoticeHandler::getVisibleNotices() implementation Closes #1729 --- 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;