Page 1 of 1

<StripCharacters> and Space

Posted: 23 Aug 2007, 04:55
by jflowers45
I do not have the space character in the <stripCharacters> yet it seems to be included. I'm on SFS 1.5.5 and not 1.5.8c but I didn't see anything mentioned in the release notes.

Is there a way to exclude it or will I need to write my own filtering function into my extension?

Thanks!

Posted: 24 Aug 2007, 17:22
by Lapo
could you tell me which characters are you stripping?

Posted: 27 Aug 2007, 16:18
by jflowers45
<StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>

Posted: 27 Aug 2007, 16:40
by patso
yep that problem is strange.

I'm using 1.5.8c and when I've tried it seems that no character is striped no matter that the BadWordsFilter is active(and it works the bad words are censored).

Posted: 27 Aug 2007, 16:50
by Lapo
mmm... maybe there's a misunderstanding here.
The StripCharacter function specifies which characters should be stripped from the original message / name etc... before checking for bad words
It can be used to avoid that a certain "BadWord" is interspersed with other characters.

Example: B_a_d_____W_o___r_d

if you add "_" to the list of stripped chars, the bad word will be recognized.

Makes sense?

Posted: 27 Aug 2007, 16:56
by patso
Yep, now make sense. Yes I've tried it and the space is not striped(on 1.5.8c) - "B_a_d_____W_o___r_d" is recognized as bad word but "B a d W o r d" is not so it doesn't strip the spaces.

jflowers45 - can you give the exact case when it doesn't work?

Posted: 30 Aug 2007, 03:26
by Lapo
I am using 1.5.8c and works okay for me!
Patso, sorry for the dumb question, did you add the " " (empty space) in the list of characters that should be stripped?

Posted: 04 Sep 2007, 15:13
by patso
Lapo wrote:I am using 1.5.8c and works okay for me!
Patso, sorry for the dumb question, did you add the " " (empty space) in the list of characters that should be stripped?
I think we have some lost in translation situation :). I am also using 1.5.8c and it works.

Ok. One by one.

Lets say that the we have the word "word" in the bad words list.

I understand the jflowers45 problem that "w ord" is recognized as bad word no matter that the space(" ") is not included in <stripCharacters>.

What I mean is that when I've tried "w,o#.rd" is recognized as bad word because ",", "." and "#" are in the <stripCharacters> list. When I've tired "w ord" and "w o r d" both are NOT recognized as bad words because space(" ") is not included in <stripCharacters>. So I don't have the jflowers45 problem and for me it seems to work. Of course when I've added the space(" ") in the <stripCharacters> list both "w ord" and "w o r d" were recognized as bad words.

Sorry for not clarify this earlier but I was a little busy recently.

Posted: 04 Sep 2007, 16:31
by Lapo
Thanks for the explanation!
All clear :D