From 8d61bc07e40603f0ad2dc8c718efd0a3663b19f5 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 18 Dec 2019 16:25:49 +1300 Subject: [PATCH 1/3] Prevent notice script_name not defined > ( ! ) Notice: Undefined index: SCRIPT_NAME in endor/piwik/piwik-php-tracker/PiwikTracker.php on line 1815 --- PiwikTracker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PiwikTracker.php b/PiwikTracker.php index ddd93f8..9124351 100644 --- a/PiwikTracker.php +++ b/PiwikTracker.php @@ -1811,7 +1811,7 @@ protected static function getCurrentScriptName() } } } - if (empty($url)) { + if (empty($url) && isset($_SERVER['SCRIPT_NAME'])) { $url = $_SERVER['SCRIPT_NAME']; } From 10828556f7ffbbe2abe1f71cd341eaf65702f74e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 18 Dec 2019 16:27:25 +1300 Subject: [PATCH 2/3] Update PiwikTracker.php --- PiwikTracker.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PiwikTracker.php b/PiwikTracker.php index 9124351..a0ff7d3 100644 --- a/PiwikTracker.php +++ b/PiwikTracker.php @@ -1813,6 +1813,8 @@ protected static function getCurrentScriptName() } if (empty($url) && isset($_SERVER['SCRIPT_NAME'])) { $url = $_SERVER['SCRIPT_NAME']; + } elseif (empty($url)) { + $url = '/'; } if ($url[0] !== '/') { From cabcdc4bb28fda9bc75f71c12e279d963c7a768a Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Sun, 22 Dec 2019 09:15:27 +1300 Subject: [PATCH 3/3] Update PiwikTracker.php --- PiwikTracker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PiwikTracker.php b/PiwikTracker.php index a0ff7d3..a4ab871 100644 --- a/PiwikTracker.php +++ b/PiwikTracker.php @@ -1817,7 +1817,7 @@ protected static function getCurrentScriptName() $url = '/'; } - if ($url[0] !== '/') { + if (!empty($url) && $url[0] !== '/') { $url = '/' . $url; }