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