<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -53,7 +53,7 @@ class Sanitize
   # or more characters followed by a colon is considered a match, even if the
   # colon is encoded as an entity and even if it's an incomplete entity (which
   # IE6 and Opera will still parse).
-  REGEX_PROTOCOL = /^([^:]*)(?:\:|&amp;#0*58|&amp;#x0*3a)/i
+  REGEX_PROTOCOL = /^([A-Za-z0-9\+\-\.\&amp;\;\#\s]*?)(?:\:|&amp;#0*58|&amp;#x0*3a)/i
 
   #--
   # Instance Methods</diff>
      <filename>lib/sanitize.rb</filename>
    </modified>
    <modified>
      <diff>@@ -248,6 +248,11 @@ describe 'Custom configs' do
     Sanitize.clean(input, {:elements =&gt; ['p'], :attributes =&gt; {'div' =&gt; ['class']}}).should.equal('&lt;p&gt;bar&lt;/p&gt;')
     Sanitize.clean(input, {:elements =&gt; ['p'], :attributes =&gt; {'p' =&gt; ['title'], :all =&gt; ['class']}}).should.equal(input)
   end
+  
+  should 'allow relative URLs containing colons where the colon is not in the first path segment' do
+    input = '&lt;a href=&quot;/wiki/Special:Random&quot;&gt;Random Page&lt;/a&gt;'
+    Sanitize.clean(input, { :elements =&gt; ['a'], :attributes =&gt; {'a' =&gt; ['href']}, :protocols =&gt; { 'a' =&gt; { 'href' =&gt; [:relative] }} }).should.equal(input)
+  end
 end
 
 describe 'Sanitize.clean' do</diff>
      <filename>test/spec_sanitize.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5d01e561fa1c554ea46b621d77f2e278c7771050</id>
    </parent>
  </parents>
  <author>
    <name>peter</name>
    <email>peter@biggie.local</email>
  </author>
  <url>http://github.com/rgrove/sanitize/commit/8550b8afae09ad5a22f70c3d2e4838cbfeebdcfc</url>
  <id>8550b8afae09ad5a22f70c3d2e4838cbfeebdcfc</id>
  <committed-date>2009-05-19T18:29:16-07:00</committed-date>
  <authored-date>2009-05-19T18:29:16-07:00</authored-date>
  <message>Changed protocol regex to ensure Sanitize doesn't kill URLs with colons in path segments</message>
  <tree>e31088cadc587d34c7e8c01ec3ba14110c1ffc1a</tree>
  <committer>
    <name>peter</name>
    <email>peter@biggie.local</email>
  </committer>
</commit>
