Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URL extension parsing #1602

Merged
merged 2 commits into from Jul 29, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+2 −1
Diff settings

Always

Just for now

@@ -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)

This comment has been minimized.

Copy link
@PromoFaux

PromoFaux Jul 16, 2017

Member

Was this not working before because it wasn't actually setting a variable anywhere? If that's the case... 1/2

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');

This comment has been minimized.

Copy link
@PromoFaux

PromoFaux Jul 16, 2017

Member

2/2... does this fix now render this line unnecessary?

From my testing, I tried with http://adfoc.us/serve/sitelinks/?id=ANID&url=google.aspx (a valid URL extension not on the list!). Before I applied this change, I got the blank block page, and afterwards I got the full block page.

Seems to make sense to me, but @WaLLy3K may want to confirm as block page is his baby!

This comment has been minimized.

Copy link
@WaLLy3K

WaLLy3K Jul 17, 2017

Collaborator

http://adfoc.us/serve/sitelinks/?id=ANID&url=google.aspx is designed to be invalid, as anything with a ? query string is broadly determined to be a file, rather than attempting further detection.

That is to say, that's how I originally intended for it to be - I'm not 120% familiar with the current Block Page derivative as I am with my own.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.