From 9934f505a5c717d39167f705a818b25e8cdfda5a Mon Sep 17 00:00:00 2001 From: Molikuner Date: Thu, 13 Jul 2017 23:18:40 +0200 Subject: [PATCH] Fix URL extension parsing when there is a querystring Pi-hole sometimes parsed a wrong extension --- advanced/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index 1dd5acc77..2facd144b 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -21,8 +21,9 @@ function validIP($address){ } // Retrieve server URI extension (EG: jpg, exe, php) +// strtok($uri, '\?') splits the querystring from the path (if there is a querystring) ini_set('pcre.recursion_limit',100); -$uriExt = pathinfo($uri, PATHINFO_EXTENSION); +$uriExt = pathinfo(strtok($uri,'\?'), PATHINFO_EXTENSION); // Define which URL extensions get rendered as "Website Blocked" $webExt = array('asp', 'htm', 'html', 'php', 'rss', 'xml');