Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
filter.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2012 at 21:33 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedSo, of two things one is true:
A. Drupal 6's _filter_url() has a bug in it which causes it to not recognize a '!' in a URL. (I'd link to http://api.drupal.org/api/drupal/modules!filter!filter.module/function/_... ... but I can't.)
B. A '!' is not a valid character in a URL, and this is a new bug in API module.
Comment #2
joachim commentedAccording to http://www.ietf.org/rfc/rfc3986.txt, a '!' is a sub-delim character. Whatever that is -- the spec doesn't really explain.
In which case it's a Drupal core bug. Those URLs work fine on D7. The '!' appears in the D6 regex, but perhaps there's an error in there somewhere?
Comment #3
joachim commentedUpdating title.
Comment #4
battlecrop commentedYou can try by replacing ! of the url by its special code for example space is %20
Comment #5
bdragon commentedNo, you shouldn't escape ! in a url.
should probably be
FWIW, to be fully compliant it should also support $ and ( ), but the parenthesis are problematic because the close paren is likely to occur both as the last character in the url (wikipedia disambiguation pages, as an example) and surrounding the link, so other than keeping track of any open parens, there isn't a good way to distinguish them.
Comment #6
gregglesI am uniquely gifted at taking other people's comments with code and turning them into patches.
Comment #7
joachim commentedPatch works for me. Thanks!
Comment #8
Drave Robber commentedMarked #1610342: Some API links are not converted into proper links as a duplicate of this.
Comment #9
sunLooks good to me as well.
Comment #10
sun#6: 1480992_url_filter_allow_exclamations.patch queued for re-testing.
Comment #11
joachim commentedPlease please please could this get committed, so that it can then be deployed on d.org?
It makes a total mockery of having an API site when we can't link to function documentation in issues!
Comment #12
Sepero commentedHere's a fix. Go into modules/filter/filter.module and replace the function _filter_url with this:
It fixes all these open bugs:
https://drupal.org/node/550464
https://drupal.org/node/2016089
https://drupal.org/node/1899246
https://drupal.org/node/1480992
https://drupal.org/node/1055864
It also fixes unknown/unmarked bugs:
Can't use foreign characters in email addresses.
Can't use many valid characters like '$%' in email addresses.
Can't preceed www web addresses with an html break.
Many html codes can't be used to end a url or email link.