<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>AutoFormat.Linkify does now allow parentheses in url path</title>
        <description>I'm having an issue with AutoFormat.Linkify mangling urls that contain parentheses.

My understanding is that the following url is valid:
http://en.wikipedia.org/wiki/Comet_(programming)

You can see on the HTMLPurifier AutoFormat live demo that the linking behavior does not capture the entire url (it only captures the url up to the opening of the parenthesis).

Is this expected behavior? Is there something I can do to whitelist parens in the path of an url without sacrificing the security benefits of HTMLPurifier?

Here's the live demo link:

http://htmlpurifier.org/demo.php?filter%5BAutoFormat.AutoParagraph%5D=0&amp;amp;filter%5BAutoFormat.DisplayLinkURI%5D=0&amp;amp;filter%5BAutoFormat.Linkify%5D=1&amp;amp;filter%5BAutoFormat.RemoveEmpty%5D=0&amp;amp;filter%5BAutoFormat.RemoveSpansWithoutAttributes%5D=0&amp;amp;filter%5BNull_CSS.AllowedProperties%5D=1&amp;amp;filter%5BCore.CollectErrors%5D=0&amp;amp;filter%5BNull_HTML.Allowed%5D=1&amp;amp;filter%5BNull_HTML.Doctype%5D=1&amp;amp;filter%5BHTML.SafeObject%5D=0&amp;amp;filter%5BHTML.TidyLevel%5D=medium&amp;amp;filter%5BURI.DisableExternalResources%5D=0&amp;amp;filter%5BNull_URI.Munge%5D=1&amp;amp;html=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComet_%28programming%29&amp;amp;submit=Submit&amp;amp;experimental=1</description>
        <link>http://htmlpurifier.org/phorum/read.php?3,6333,6333#msg-6333</link>
        <lastBuildDate>Sat, 18 May 2013 20:23:54 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6333,6377#msg-6377</guid>
            <title>Re: AutoFormat.Linkify does now allow parentheses in url path</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6333,6377#msg-6377</link>
            <description><![CDATA[<p>If you do want to tweak the code, all you have to do is fix the regex in library/HTMLPurifier/Injector/Linkify.php</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Tue, 08 May 2012 11:58:52 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6333,6376#msg-6376</guid>
            <title>Re: AutoFormat.Linkify does now allow parentheses in url path</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6333,6376#msg-6376</link>
            <description><![CDATA[<p>When I get around to figuring out a solution to this issue I'll post my solution, so as to make this page a useful resource.</p>]]></description>
            <dc:creator>Lucas Meadows</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 07 May 2012 22:49:37 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6333,6375#msg-6375</guid>
            <title>Re: AutoFormat.Linkify does now allow parentheses in url path</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6333,6375#msg-6375</link>
            <description><![CDATA[<p>That comment was profoundly unhelpful, but I suppose when you're writing 400+ posts per year you can no longer afford to spend the time necessary to provide meaningful assistance. Sweet post count though, broseph!</p>]]></description>
            <dc:creator>Lucas Meadows</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 07 May 2012 22:47:26 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6333,6334#msg-6334</guid>
            <title>Re: AutoFormat.Linkify does now allow parentheses in url path</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6333,6334#msg-6334</link>
            <description><![CDATA[<p>Yes, it's intentional, and intended to handle cases like this: (<a href="http://google.com">http://google.com</a>). There's no knob to fix it but I imagine tweaking the code wouldn't be too difficult.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 30 Apr 2012 15:30:20 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?3,6333,6333#msg-6333</guid>
            <title>AutoFormat.Linkify does now allow parentheses in url path</title>
            <link>http://htmlpurifier.org/phorum/read.php?3,6333,6333#msg-6333</link>
            <description><![CDATA[<p>I'm having an issue with AutoFormat.Linkify mangling urls that contain parentheses.</p>

<p>My understanding is that the following url is valid:
<a href="http://en.wikipedia.org/wiki/Comet_">http://en.wikipedia.org/wiki/Comet_</a>(programming)</p>

<p>You can see on the HTMLPurifier AutoFormat live demo that the linking behavior does not capture the entire url (it only captures the url up to the opening of the parenthesis).</p>

<p>Is this expected behavior? Is there something I can do to whitelist parens in the path of an url without sacrificing the security benefits of HTMLPurifier?</p>

<p>Here's the live demo link:</p>

<p><a href="http://htmlpurifier.org/demo.php?filter%5BAutoFormat.AutoParagraph%5D=0&amp;filter%5BAutoFormat.DisplayLinkURI%5D=0&amp;filter%5BAutoFormat.Linkify%5D=1&amp;filter%5BAutoFormat.RemoveEmpty%5D=0&amp;filter%5BAutoFormat.RemoveSpansWithoutAttributes%5D=0&amp;filter%5BNull_CSS.AllowedProperties%5D=1&amp;filter%5BCore.CollectErrors%5D=0&amp;filter%5BNull_HTML.Allowed%5D=1&amp;filter%5BNull_HTML.Doctype%5D=1&amp;filter%5BHTML.SafeObject%5D=0&amp;filter%5BHTML.TidyLevel%5D=medium&amp;filter%5BURI.DisableExternalResources%5D=0&amp;filter%5BNull_URI.Munge%5D=1&amp;html=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComet_%28programming%29&amp;submit=Submit&amp;experimental=1">http://htmlpurifier.org/demo.php?filter%5BAutoFormat.AutoParagraph%5D=0&amp;filter%5BAutoFormat.DisplayLinkURI%5D=0&amp;filter%5BAutoFormat.Linkify%5D=1&amp;filter%5BAutoFormat.RemoveEmpty%5D=0&amp;filter%5BAutoFormat.RemoveSpansWithoutAttributes%5D=0&amp;filter%5BNull_CSS.AllowedProperties%5D=1&amp;filter%5BCore.CollectErrors%5D=0&amp;filter%5BNull_HTML.Allowed%5D=1&amp;filter%5BNull_HTML.Doctype%5D=1&amp;filter%5BHTML.SafeObject%5D=0&amp;filter%5BHTML.TidyLevel%5D=medium&amp;filter%5BURI.DisableExternalResources%5D=0&amp;filter%5BNull_URI.Munge%5D=1&amp;html=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComet_%28programming%29&amp;submit=Submit&amp;experimental=1</a></p>]]></description>
            <dc:creator>Lucas Meadows</dc:creator>
            <category>Support</category>
            <pubDate>Mon, 30 Apr 2012 15:26:49 -0400</pubDate>
        </item>
    </channel>
</rss>
