summarylogtreecommitdiffstats
path: root/issue_1598.patch
blob: aefaaf06f7d486acc16ee041ac6d5c3ed34a4b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 9934f505a5c717d39167f705a818b25e8cdfda5a Mon Sep 17 00:00:00 2001
From: Molikuner <molikuner@gmail.com>
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');