From 78e6dd7adc85277663a23df191451dc3d9cfc395 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 8 Jan 2021 15:13:16 +0100 Subject: [PATCH] Remove Facebook fbclid --- core/core.js.php | 7 +++++++ core/core.php | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/core.js.php b/core/core.js.php index be5c6b9d..09bfb0dd 100755 --- a/core/core.js.php +++ b/core/core.js.php @@ -472,4 +472,11 @@ $(document).ready(function(){ $(changeIcon).addClass('zwiico-menu'); }; }); + + /** + * Remove ID Facebook from URL + */ + if(/^\?fbclid=/.test(location.search)) + location.replace(location.href.replace(/\?fbclid.+/, "")); + }); diff --git a/core/core.php b/core/core.php index 738b4fa8..95995258 100755 --- a/core/core.php +++ b/core/core.php @@ -561,7 +561,16 @@ class common { // Une partie de l'url else { $url = explode('/', $this->url); - return array_key_exists($key, $url) ? $url[$key] : null; + if (array_key_exists($key, $url) ) { + if (strpos($url[$key],'fbclid=') === false) { + $result = $url[$key]; + } else { + $result = $key === 0 ? $this->getData(['config','homePageId']) : ''; + } + } else { + $result = null; + } + return $result; } }