Skip to content
Snippets Groups Projects
Commit 20ebf68a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix php8 warnings, fixes #1911

Closes #1911

Merge request studip/studip!1255
parent 653fcaba
No related branches found
No related tags found
No related merge requests found
...@@ -163,8 +163,8 @@ class MyRealmModel ...@@ -163,8 +163,8 @@ class MyRealmModel
public static function getCourses($min_sem_key, $max_sem_key, $params = []) public static function getCourses($min_sem_key, $max_sem_key, $params = [])
{ {
// init // init
$order_by = $params['order_by']; $order_by = $params['order_by'] ?? null;
$order = $params['order']; $order = $params['order'] ?? null;
$deputies_enabled = $params['deputies_enabled']; $deputies_enabled = $params['deputies_enabled'];
$sem_data = Semester::getAllAsArray(); $sem_data = Semester::getAllAsArray();
...@@ -179,7 +179,7 @@ class MyRealmModel ...@@ -179,7 +179,7 @@ class MyRealmModel
} }
$semesters = Semester::findMany($semester_ids); $semesters = Semester::findMany($semester_ids);
$studygroup_filter = !$params['studygroups_enabled'] ? false : true; $studygroup_filter = !empty($params['studygroups_enabled']);
$ordering = ''; $ordering = '';
// create ordering // create ordering
if (!$order_by) { if (!$order_by) {
......
...@@ -195,7 +195,7 @@ class ResponsiveHelper ...@@ -195,7 +195,7 @@ class ResponsiveHelper
$currentIndex = -1; $currentIndex = -1;
foreach ($sem_data as $index => $semester) { foreach ($sem_data as $index => $semester) {
if ($semester['current']) { if (!empty($semester['current'])) {
$currentIndex = $index; $currentIndex = $index;
break; break;
} }
......
...@@ -67,7 +67,7 @@ class URLHelper ...@@ -67,7 +67,7 @@ class URLHelper
return $url; return $url;
} }
if ($url[0] === '/') { if (isset($url[0]) && $url[0] === '/') {
preg_match('%^[a-z]+://[\w:.-]+%', $base_url, $host); preg_match('%^[a-z]+://[\w:.-]+%', $base_url, $host);
$base_url = $host[0] ?? ''; $base_url = $host[0] ?? '';
} }
......
...@@ -287,7 +287,7 @@ if ($navigation) { ...@@ -287,7 +287,7 @@ if ($navigation) {
<nav id="navigation-level-2" aria-current="page" aria-label="<?= _('Zweite Navigationsebene') ?>"> <nav id="navigation-level-2" aria-current="page" aria-label="<?= _('Zweite Navigationsebene') ?>">
<? if (PageLayout::isHeaderEnabled() /*&& isset($navigation)*/) : ?> <? if (PageLayout::isHeaderEnabled() /*&& isset($navigation)*/) : ?>
<?= $this->render_partial('tabs', compact('navigation', 'membership')) ?> <?= $this->render_partial('tabs', compact('navigation')) ?>
<? endif; ?> <? endif; ?>
</nav> </nav>
<? endif; ?> <? endif; ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment