summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-13 14:44:20 +0200
committerSimon Rettberg2022-05-13 14:44:20 +0200
commitfe405479f16ecce774341baefe44863dc89aeb48 (patch)
tree05c5a9b762be53c8c3ef3c4affaca374b04c755c /modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
parent[eventlog] Cast numeric values to int explicitly, in case they are '' (diff)
downloadslx-admin-fe405479f16ecce774341baefe44863dc89aeb48.tar.gz
slx-admin-fe405479f16ecce774341baefe44863dc89aeb48.tar.xz
slx-admin-fe405479f16ecce774341baefe44863dc89aeb48.zip
[locationinfo] His: Remove lecture IDs from event names
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
index 8bd18169..cccbef91 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
@@ -43,6 +43,15 @@ class CourseBackend_HisInOne extends ICalCourseBackend
return $value;
}
+ protected function toTitle(ICalEvent $event): string
+ {
+ $title = parent::toTitle($event);
+ // His in one seems to prefix *some* (but *not* all) of the lectures by their ID/("Nummer")
+ // No clue what that format is supposed to be, this regex is some guesswork after observing this for a while
+ $title = preg_replace('#^[0-9][0-9A-ZÄÖÜ]{3,9}-[A-Za-z0-9/_ÄÖÜäöüß.-]{4,20}\s+#u', '', $title);
+ return $title;
+ }
+
public function checkConnection()
{
if (!$this->isOK())