Hi here,

First, thanks for your great module, it's simple to use, it's usefull.... it's a very good module ;)

However I noticed a strange behavior that I associate to a bug :

In my case, I have to replace some "group of words" (that are my products), and automatically put a link when these words are found example :

TV samsung|<a href="/node/10">TV samsung</a>

The problem is that the module put

<a href="/node/10">TV samsung</a>

2 times because of the space I think. If I have to replace "Super TV samsung", it will make the replacement 3 times etc.... Even with the standalone checkbox checked.

Do I miss something or it is the correct behavior of the module ATM ? And it is a bug or it is the way you want to make it ? (because I have some difficulties to understand the use case in which that behavior is usefull).

regards,

zmove

CommentFileSizeAuthor
#3 wordfilter.module.263608.patch1.09 KBjaydub

Comments

zmove’s picture

It seems that, in addition, the replacement text autofilter himself example :

If I define this rule :

TV samsung|Test

And in my node I have this sentence : "Please, buy a TV samsung"

It will replace my sentence with that : "Please, buy a Test Test"

So, in this case, it should show "Please, buy a Test" => so this is a first problem.

The second problem is if I define this rule : TV samsung|TV samsung

And I write this sentence "Please, buy a TV samsung"

it will output :

Please, buy a
<a href="/node/10">TV </a>
<a href="/node/10">TV samsung</a>
<a href="/node/10">TV samsung</a>

=> Second problem

The first problems seems to come from space, for each word separed by spaces, it will apply a new filter as I explained in my first post.

For the second problem, it seems that, because I replace a word with the same word (the word inside the link is the same), it apply the filter on the filtered word + the problem of space, that's why, I think, I have this strange output for my second case.

Can you reproduct the problem or am I alone in this case ?

regards,

zmove

jaydub’s picture

well first off if you are intending to filter on node and/or
comment titles then you will cause all sorts of problems
if you try to replace with HTML...

but as long as you are just filtering the node/comment
body then you can use HTML assuming your input
filters support it.

As for the behaviour you are reporting yes it is wrong
that your phrase is not replaced as a phrase but rather
each word is replaced. That was the way the code worked
previous to my taking on the drupal 6 port. I will have make
a change and do some testing to make sure existing filters
don't break.

jaydub’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

try this patch

zmove’s picture

Thank you for this soooo quick answer and patch !

I will test that and give you feedback.

To bring more informations, yes, I use wordfilter on node body (and some CCK textarea fields) with filtered HTML for all field, and I checked the wordfilter checkbox for filtered HTML.

Edit : The patch seems to correct the 2 problems, thank you very much guy !

PS : it is planned to include this patch in future version ?

jaydub’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.