Closed (fixed)
Project:
Go - url redirects
Version:
5.x-1.3
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
6 Dec 2006 at 04:13 UTC
Updated:
12 Nov 2007 at 22:41 UTC
Jump to comment: Most recent file
Trying to link images doesn't seem to work:
<go href="http://some.site.net/"><img src="/system/files/blah-di-blah"></go>
The tags are left alone, ie. not translated to <a>
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | gotwo.101605.patch | 657 bytes | spiderman |
Comments
Comment #1
BioALIEN commentedFast forward 9 months and a new branch for D5.x release and I can confirm this bug is still present.
Anybody wants to step in with a patch?
Comment #2
spidermanactually, i don't think this is really a bug- i found on my system that i could reproduce the "bug" until i realized that
tags were being stripped by the default Filtered HTML settings. once i added
to the admin/settings/filters/1/configure page (Allowed HTML tags), my test node with a
tagset worked fine.
incidentally, this surprised me, because i had thought there *was* a bug in the regex that grabs the args and the text of the link, around line 163:
however, when i removed my patch, the preg_replace appears to continue to work, even tho (by my read) that regex shouldn't match any
tags inside the ..: that's what the ([^<]*) says. as such, it may be that i'm out to lunch on this, and an adjustment similar to mine above is actually in order. ;)
further testing/testers appreciated: can someone confirm that simply adding the
tag to Allowed HTML tags resolves this issue?
Comment #3
spidermanalso meant to mention that i'm interested in volunteering to co-maintain this module, if that's still useful :)
Comment #4
BioALIEN commentedHi spiderman,
I'd love to have you on board, check your email!
Just tested your suggestion about adding the
tag to the list of allowed HTML tags. It didn't work for me. This is also the same for Full HTML (which automatically accepts all HTML tags) so it's not just a problem with Filtered HTML.
Here's what I used:
The first link will work fine, but the 2nd link will just show an image with no link. Hope this helps.
Comment #5
Zen commentedSpiderman has been added as a co-maintainer for this module.
-K
Comment #6
spidermanok following this up some more, it seems my initial hunch was correct- the regex that was looking for tags was excluding/stripping any with other html inside them. i've attached a proper patch to the module which fixes the problem for me. steps to recreate:
0. setup test/sandbox drupal 5.3 install
1. drop gotwo.module into sites/all/modules
2. apply this patch
3. enable gotwo module on admin/build/modules page
4. enable gotwo filter on admin/settings/filters/1 page (filtered html config)
5. rearrange filtered html weights so that the go filter happens first (or at least before html and url filters)
6. create a new page, with a link like the following somewhere in the text:
preview or save the page, and you should see the drupal logo with the word 'test' on either side of it, all as a link. also test removing the 'test' words, so the link becomes just the logo.
i'm quite sure this patch works to include img and other tags allowed by the html filter, so the only other issues i'm worried about are edge cases we haven't considered. anyone know the reasoning why this regex was so restrictive in the first place?
Comment #7
BioALIEN commentedJust tried this patch, works as advertised. I also tried various tests and it works as advertised.
RTBC :)
Comment #8
spidermani've just committed the patch. the updated version of gotwo.module is here.
thanks for the review, BioALIEN :)
Comment #9
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.