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

prevent php8 warnings (fourth batch of changes), re #2193

Merge request studip/studip!1426
parent 718af22c
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,7 @@
* @var Admin_PluginController $controller
* @var array $plugin
*/
?>
<?
if (mb_strpos($_SERVER['SERVER_NAME'], ':') !== false) {
list($_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']) =
explode(':', $_SERVER['SERVER_NAME']);
......@@ -26,7 +25,7 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 ||
<?= $m ?>
<? endforeach ?>
</div>
<form action="<?= $controller->url_for('admin/plugin/edit_automaticupdate/'.$plugin['id']) ?>" method="post" class="default" data-dialog="size=auto;reload-on-close">
<form action="<?= $controller->link_for('admin/plugin/edit_automaticupdate', $plugin['id'] ?? null) ?>" method="post" class="default" data-dialog="size=auto;reload-on-close">
<?= CSRFProtection::tokenTag() ?>
<input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
<?= MessageBox::info(_("Sie können gitlab, github.com oder dem neuen Stud.IP-Plugin-Marktplatz mitteilen, dass Ihr Stud.IP per Webhook über Änderungen im Code des Plugins benachrichtigt werden soll.")) ?>
......@@ -34,15 +33,16 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 ||
<legend><?= _("Einstellungen von Stud.IP") ?></legend>
<label>
<?= _("URL, von der das Plugin als ZIP-Datei bezogen werden soll") ?>
<input type="url" name="automatic_update_url" value="<?= htmlReady($plugin['automatic_update_url']) ?>">
<input type="url" name="automatic_update_url" value="<?= htmlReady($plugin['automatic_update_url'] ?? '') ?>">
</label>
<label>
<?= _("Automatisches Update absichern über Sicherheitstoken (optional)") ?>
<input type="checkbox" name="use_security_token" value="1"<?= $plugin['automatic_update_secret'] || !$plugin['automatic_update_url'] ? " checked" : "" ?>>
<input type="checkbox" name="use_security_token" value="1"
<?= !empty($plugin['automatic_update_secret']) || empty($plugin['automatic_update_url']) ? " checked" : "" ?>>
</label>
</fieldset>
<? if ($plugin['automatic_update_url']) : ?>
<? if (!empty($plugin['automatic_update_url'])) : ?>
<fieldset>
<legend><?= _("Daten für das bereitstellende System") ?></legend>
<p class="info">
......
......@@ -85,7 +85,8 @@ class LockRules {
*/
public static function getObjectRule($object_id, $renew = false, $object_type = null)
{
if(!array_key_exists($object_id, self::$lockmap) || $renew) {
if (!array_key_exists($object_id, self::$lockmap) || $renew) {
self::$lockmap[$object_id] = null;
if ($object_type === null) {
$object_type = get_object_type($object_id, words('sem inst user'));
}
......@@ -98,12 +99,10 @@ class LockRules {
if ($lr) {
self::$lockmap[$object_id] = $lr->getId();
self::$lockrules[$lr->getId()] = $lr;
} else {
self::$lockmap[$object_id] = null;
}
}
}
return self::$lockmap[$object_id] ? self::$lockrules[self::$lockmap[$object_id]] : null;
return self::$lockrules[self::$lockmap[$object_id]] ?? null;
}
/**
......
......@@ -73,15 +73,16 @@ function get_object_name($range_id, $object_type)
$statement->execute([$range_id]);
$row = $statement->fetch(PDO::FETCH_ASSOC);
if ($SEM_TYPE[$row['status']]['name'] == $SEM_TYPE_MISC_NAME) {
if (!$row) {
$name = _('Unbekannt');
$type = _('Veranstaltung');
} else {
$type = $SEM_TYPE[$row['status']]['name'];
}
if (!$type) {
$type = _('Veranstaltung');
$name = $row['Name'];
$type = $SEM_TYPE[$row['status']]['name'] ?? _('Veranstaltung');
if ($type === $SEM_TYPE_MISC_NAME) {
$type = _('Veranstaltung');
}
}
$name = $row['Name'];
} else if ($object_type == 'inst' || $object_type == 'fak') {
$query = "SELECT type, Name FROM Institute WHERE Institut_id = ?";
$statement = DBManager::get()->prepare($query);
......
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