From 54e80c9b73e339423575ff120a865b5268c60e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCttl=C3=B6ffel?= Date: Tue, 10 Aug 2021 10:09:26 +0000 Subject: OpenGraph: surpress warnings when fetching, abort on fail --- lib/models/OpenGraphURL.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/models/OpenGraphURL.class.php b/lib/models/OpenGraphURL.class.php index fcb495f..5df5e7f 100644 --- a/lib/models/OpenGraphURL.class.php +++ b/lib/models/OpenGraphURL.class.php @@ -172,7 +172,12 @@ class OpenGraphURL extends SimpleORMap ], ]); - $content = file_get_contents($this['url'], false, $context); + $content = @file_get_contents($this['url'], false, $context); + + if ($content === false) { + return; + } + $content = mb_encode_numericentity($content, [0x80, 0xffff, 0, 0xffff], $currentEncoding); $old_libxml_error = libxml_use_internal_errors(true); $doc = new DOMDocument(); -- cgit v1.0 From b7deb6cebb57fda85e31d3c605d99f69e19a7587 Mon Sep 17 00:00:00 2001 From: noackorama Date: Wed, 11 Aug 2021 18:59:35 +0200 Subject: do not notify user when deleting her own booking, closes #62 --- lib/models/resources/ResourceBooking.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php index ad22cef..1d53178 100644 --- a/lib/models/resources/ResourceBooking.class.php +++ b/lib/models/resources/ResourceBooking.class.php @@ -1865,6 +1865,9 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen //Nothing we can do here. return; } + if (User::findCurrent()->id === $booking_user->id) { + return; + } $template_factory = new Flexi_TemplateFactory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' -- cgit v1.0