From a2d286187f78642c907f902ed0c32506ee90a490 Mon Sep 17 00:00:00 2001 From: David Siegfried <david.siegfried@uni-vechta.de> Date: Mon, 13 Mar 2023 13:36:29 +0000 Subject: [PATCH] prevent php8 warnings, closes #2362 Closes #2362 Merge request studip/studip!1549 --- app/controllers/news.php | 4 ++-- lib/classes/Interactable.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/news.php b/app/controllers/news.php index 3cccc3ff94b..0cef4cfdc50 100644 --- a/app/controllers/news.php +++ b/app/controllers/news.php @@ -464,7 +464,7 @@ class NewsController extends StudipController } // apply filter if (Request::submitted('apply_news_filter')) { - $this->news_isvisible['basic'] = !$this->news_isvisible['basic']; + $this->news_isvisible['basic'] = empty($this->news_isvisible['basic']); if (Request::get('news_searchterm') && mb_strlen(trim(Request::get('news_searchterm'))) < 3) { PageLayout::postError(_('Der Suchbegriff muss mindestens 3 Zeichen lang sein.')); } elseif ((Request::get('news_startdate') && !$this->getTimeStamp(Request::get('news_startdate'))) || (Request::get('news_enddate') && !$this->getTimeStamp(Request::get('news_enddate'), 'end'))) { @@ -537,7 +537,7 @@ class NewsController extends StudipController } // check if result set too big $counter++; - if ($counter == $limit + 1) { + if ($counter === $limit + 1) { PageLayout::postInfo(sprintf(_('Es werden nur die ersten %s Ankündigungen angezeigt.'), $limit)); unset($this->news_items[$type][$key]); } diff --git a/lib/classes/Interactable.class.php b/lib/classes/Interactable.class.php index 6ba7c25ab7e..9796f9172b3 100644 --- a/lib/classes/Interactable.class.php +++ b/lib/classes/Interactable.class.php @@ -61,7 +61,7 @@ abstract class Interactable $class = self::hyphenate(mb_substr($name, 6)); # a.) set name unless set - if (!is_string(@$args[1])) { + if (empty($args[1]) || !is_string($args[1])) { $interactable->attributes['name'] = $class; } -- GitLab