|
DisplayRemoteLinkURI injector March 21, 2012 08:19AM |
Registered: 1 year ago Posts: 5 |
I've created a new injector named AutoFilter.DisplayRemoteLinkURI and explained at the link below about how to add it. It works like DisplayLinkURI but just for remote URL's. Local URL's stay the same. And I couldn't figure how to use DisableExternal URIFilter inside it, so I wrote a temporary function to check if link is remote or local.
http://stackoverflow.com/a/9804323/1262700
Just wanted to inform you. If it's hacking the core and not allowed, I'd remove that.
|
Re: DisplayRemoteLinkURI injector March 22, 2012 09:07PM |
Admin Registered: 6 years ago Posts: 2,636 |
|
Re: DisplayRemoteLinkURI injector March 23, 2012 03:16AM |
Registered: 1 year ago Posts: 5 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:24PM |
Admin Registered: 6 years ago Posts: 2,636 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:33PM |
Registered: 1 year ago Posts: 5 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:38PM |
Admin Registered: 6 years ago Posts: 2,636 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:41PM |
Registered: 1 year ago Posts: 5 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:47PM |
Admin Registered: 6 years ago Posts: 2,636 |
|
Re: DisplayRemoteLinkURI injector March 24, 2012 09:54PM |
Registered: 1 year ago Posts: 5 |
yes I just tested and it gives any host information that i expected. And considered as local. I expected the result would be like this :
Array ( "scheme" => "mailto:", "host" => "gmail.com", "username" = "tpaksu" )
But it gives the mail adress as "path". And BTW, "javascript:" href's would be a problem too. What else may happen?
|
Re: DisplayRemoteLinkURI injector March 24, 2012 11:20PM |
Admin Registered: 6 years ago Posts: 2,636 |
The reason why this is the case is because you only have an authority if you have a // after the scheme. So mailto doesn't, so you go straight to the path.
In general, managing the different schemes is the trickiest part of handling this, which is why I suggest using HTML Purifier's built in stuff. Check out library/HTMLPurifier/AttrTransform/Nofollow.php for an eample.