well, when pasting a link starting with http:// prefix it outputs Not a valid URL. message, working with protocol prefix si required since i am planning to use it for ftp:// either.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | protocol.patch.txt | 1.57 KB | owen barton |
well, when pasting a link starting with http:// prefix it outputs Not a valid URL. message, working with protocol prefix si required since i am planning to use it for ftp:// either.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | protocol.patch.txt | 1.57 KB | owen barton |
Comments
Comment #1
owen barton commentedMaking critical - since this bug prevents entry of any offsite URLs (not just ones with a protocol).
Here is a patch that fixes the problem. It also has improved the regex to function correctly for the mailto: protocol, since that does not include the '//' delimiter.
Comment #2
quicksketchLooks good, is the line "+print $external_pattern . $end;" debugging code?
Comment #3
owen barton commentedWhoops!
Yes - that can be taken out :)
Comment #4
quicksketchSorry about the delay on this patch! It really was quite a show-stopper!
Anyway, I found that your patch didn't actually help with mailto: since email addresses still don't fit the rest of the regular expression. I simply changed
to
Since the last protocol was being checked with the :// and the rest weren't. Released as version 1.2 on Drupal.org
Comment #5
(not verified) commented