aboutsummaryrefslogtreecommitdiff
path: root/lib/visual.inc.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-08-29 15:29:26 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-08-29 15:29:26 +0000
commit7ebc446999286d42affc5d27ea888dd997a3d95c (patch)
treee1393a88d17fcc74276460604d9ce9998379bdac /lib/visual.inc.php
parentfd375126142decc222c1f61369dc198fb58b7f6e (diff)
prevent php8 warnings, fixes #3106
Closes #3106 Merge request studip/studip!2095
Diffstat (limited to 'lib/visual.inc.php')
-rw-r--r--lib/visual.inc.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/visual.inc.php b/lib/visual.inc.php
index 8503a5c..2b37a64 100644
--- a/lib/visual.inc.php
+++ b/lib/visual.inc.php
@@ -399,14 +399,13 @@ function symbol ($text = '')
function mila ($titel, $size = 60) {
global $auth;
- if ($auth->auth["jscript"] AND $size == 60) {
+ if (!empty($auth->auth['jscript']) && $size == 60) {
//hier wird die maximale Laenge berechnet, nach der Abgeschnitten wird (JS dynamisch)
- if (mb_strlen ($titel) >$auth->auth["xres"] / 13)
- $titel=mb_substr($titel, 0, $auth->auth["xres"] / 13)."... ";
- }
- else {
- if (mb_strlen ($titel) >$size)
- $titel=mb_substr($titel, 0, $size)."... ";
+ if (mb_strlen($titel) > $auth->auth['xres'] / 13) {
+ $titel = mb_substr($titel, 0, $auth->auth['xres'] / 13) . '... ';
+ }
+ } elseif (mb_strlen ($titel) >$size) {
+ $titel = mb_substr($titel, 0, $size) . '... ';
}
return $titel;
}