Technical Details
Forum version : #phpBB3
Position : Administrator
Concerned browser(s) : Other
Who the problem concerns : All members
When the problem appeared : Some days ago
Forum link : http://www.a-4-d.com/
Description of problem
Hi,I have the following script on my forum:
- Code:
$(function() {
var link_words = {
};
var link_regex = [];
for (w in link_words) link_regex.push(w);
link_regex = RegExp('\\b(' + link_regex.join('|') + ')\\b(?=\\W)', 'gi');
for(var i = 0, post = $('.post .content'), p; (p = post[i++]); ) {
p.innerHTML = p.innerHTML.replace(link_regex, function (m) {
return '<a class="post-word-link" href="' + link_words[m.toLowerCase()] + '">' + m + '</a>';
});
}
});
What it does it to automatically create links of words or expression to webpages as defined in the database. It is quite neat, it means that whenever a post is created containing a specific word or expression, that word or expression is automatically made into a link that directs readers to another webpage when clicked.
This script has worked well for a few years now, expect if any of the keywords are found in an image link, then the link is broken.
Recently, whenever starting a thread where the thread title contains a keyword, any embedding of images fails. Even if the image link does not contain the keyword, if the keyword is found in the thread title, the image link is broke and the image is not displayed.
What is happening?