Hi all,
I wish to use the "Activate all Terms on site?" option of the Glossary / Dictionary Page / FAQ Module. As I have a rather small site with only cacheable pages, the bad performance of the option is not an issue.
Unfortunately the current implementation of this option will try to add links in too many places of a page, most notably it will not ignore attribute values of HTML tags.
Consider if TERM is a defined term in the model and the page in question contains the following:
It is also possible to use TERM as an replacement (read more)...
In this case both instances of "TERM" will get linkified resulting in:
It is also possible to use TERM as an replacement (TERM?">read more)...
which is clearly not valid HTML.
I have tried with different regular expressions (involving negative prefixes and like), but none have worked properly until now.
I believe I can see a way out using preg_replace_callback, but before I go into this I want to hear if anybody else have seen this problem and (hopefully) solved it. Alternative modules could be an option too.
/tonny
Problems with HTML tag attributes and Glossary / Dictionary Page / FAQ Module
Problems with HTML tag attributes and Glossary / Dictionary Page / FAQ Module
cmsms is just a necessary hoppy. Eclipse is my work.
-
- Forum Members
- Posts: 19
- Joined: Fri Dec 01, 2006 11:22 am
- Location: Germany
Re: Problems with HTML tag attributes and Glossary / Dictionary Page / FAQ Modul
Hi tonny,
here is a workaround (works only with western latin (ISO-8859-1) characters):
In the file Glossary.module.php, function CreateTermLink() replace the two occurrences of
addslashes(strip_tags($def))
with
htmlentities(substr(utf8_decode(strip_tags($def)),0,512))
I guess, this is not a perfect fix, but it works on my site.
Eberhard
here is a workaround (works only with western latin (ISO-8859-1) characters):
In the file Glossary.module.php, function CreateTermLink() replace the two occurrences of
addslashes(strip_tags($def))
with
htmlentities(substr(utf8_decode(strip_tags($def)),0,512))
I guess, this is not a perfect fix, but it works on my site.
Eberhard
Re: Problems with HTML tag attributes and Glossary / Dictionary Page / FAQ Modul
Thanks for the tip. I will look into this when I get some time... /tonny
cmsms is just a necessary hoppy. Eclipse is my work.