<?php
namespace wcf\system\exception;
use wcf\system\box\BoxHandler;
+use wcf\system\notice\NoticeHandler;
use wcf\system\session\SessionHandler;
use wcf\system\WCF;
use wcf\system\WCFACP;
public function show() {
if (!class_exists(WCFACP::class, false)) {
BoxHandler::disablePageLayout();
+ NoticeHandler::disableNotices();
}
SessionHandler::getInstance()->disableTracking();
*/
protected $notices = [];
+ /**
+ * suppresses display of notices
+ * @var boolean
+ */
+ protected static $disableNotices = false;
+
/**
* @inheritDoc
*/
* @return Notice[]
*/
public function getVisibleNotices() {
+ if (self::$disableNotices) {
+ return [];
+ }
+
$notices = [];
foreach ($this->notices as $notice) {
if ($notice->isDismissed()) continue;
return $notices;
}
+
+ /**
+ * Disables the display of notices for the active page.
+ */
+ public static function disableNotices() {
+ self::$disableNotices = true;
+ }
}
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\SystemException;
+use wcf\system\notice\NoticeHandler;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
use wcf\util\FileUtil;
else {
@header('HTTP/1.1 503 Service Unavailable');
BoxHandler::disablePageLayout();
+ NoticeHandler::disableNotices();
WCF::getTPL()->assign([
'templateName' => 'offline',
'templateNameApplication' => 'wcf'