Reputation: 576
I want to match by hostname and I can't figure out how,
example: i want to force all links to be from oi*.tinypic.com
or i*.tinypic.com
. However people bypass my current validation by using then adding hash at the back of the URL like .jpg#tinypic
, if i use stripos()
to prevent abuse on the forum.
also, how do i check it's well formed url, of https or http? I'm using parse_url()
and doing if (!$var)
but it sometimes doesn't work for some reason i don't know
Upvotes: 0
Views: 82
Reputation: 198324
Use parse_url()
on the referer, then use strpos
only on host
part.
When parse_url()
doesn't work, what is the result? print_r
is your friend.
Upvotes: 1