From d03b1824d8ee964ac8755f61f436dba9b7719197 Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Wed, 17 Apr 2024 14:15:56 +0200 Subject: [PATCH] Check if origin is set --- src/Widget/Twig/TwigPreprocessor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Widget/Twig/TwigPreprocessor.php b/src/Widget/Twig/TwigPreprocessor.php index d97ddcb0..e2372ca5 100644 --- a/src/Widget/Twig/TwigPreprocessor.php +++ b/src/Widget/Twig/TwigPreprocessor.php @@ -344,7 +344,9 @@ public function preprocessEventDetail(Event $event, string $langcode, array $set // Share links $shareUrl = Url::factory($this->socialHost . '/event/' . $event->getCdbid()); $shareQuery = $shareUrl->getQuery(); - $shareQuery['origin'] = $_GET['origin']; + if (isset($_GET['origin'])) { + $shareQuery['origin'] = $_GET['origin']; + } $variables['share_links'] = [ 'facebook' => 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($shareUrl->__toString()),