diff options
-rw-r--r-- | modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php | 9 | ||||
-rw-r--r-- | modules-available/locationinfo/inc/icalcoursebackend.inc.php | 7 |
2 files changed, 13 insertions, 3 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()) diff --git a/modules-available/locationinfo/inc/icalcoursebackend.inc.php b/modules-available/locationinfo/inc/icalcoursebackend.inc.php index fba0866c..c1791919 100644 --- a/modules-available/locationinfo/inc/icalcoursebackend.inc.php +++ b/modules-available/locationinfo/inc/icalcoursebackend.inc.php @@ -43,11 +43,11 @@ abstract class ICalCourseBackend extends CourseBackend } /** - * @param int $roomId room id + * @param string $roomId room id * @param callable $errorFunc * @return ICalEvent[]|null all events for this room in the range -7 days to +7 days, or NULL on error */ - protected function downloadIcal($roomId) + protected function downloadIcal(string $roomId) { if (!$this->isOK()) return null; @@ -118,9 +118,10 @@ abstract class ICalCourseBackend extends CourseBackend /** * Get a usable title from either SUMMARY or DESCRIPTION + * * @param ICalEvent $event */ - private function toTitle($event): string + protected function toTitle(ICalEvent $event): string { $title = $event->summary; if (empty($title)) { |