ElkArte Community

Title: Censoring setting reversed
Post by: Burke Knight on June 09, 2015, 08:18:20 pm
QuoteIgnore case when censoring.

If that is checked, then it will not ignore case, but will, if unchecked.
Should be reversed, due to the wording, eh?

My test was:
:BKE would then get changed to BurkeKnight Enterprises

If have it checked, then when do :bke all it showed was :bke in the test.
But, if unchecked it: :bke changed to BurkeKnight Enterprises
Title: Re: Censoring setting reversed
Post by: emanuele on June 10, 2015, 03:39:03 am
Works fine here (see attach).

Just to be sure: did you save the setting between a test and the other?
Because in fact the interface may lead to confusion: the test is done on the saved settings, and settings are not saved until you click on "save".

@Spuds I wonder if tests should (with a warning?) use the displayed settings.
Title: Re: Censoring setting reversed
Post by: Burke Knight on June 10, 2015, 06:28:21 am
Yes, I had saved. I had tested it both with caps and without, on both settings after saving, and even leaving admin and returning.

These are taken today, with saved setting of ignore case. First was test using no caps and 2nd with caps.
They both should have changed, if it was following the ignore case.

Edit: Does it make any difference that you have Check only Whole Words checked?

EDIT 2: Yes! That was it! I tested with that checked, and it works as is supposed to.
So, this issue is only when that is unchecked.
Title: Re: Censoring setting reversed
Post by: emanuele on June 10, 2015, 09:05:40 am
Ohhh.... yes, I was looking at the regexp and missed the str_ireplace below.
Yup, it looks like that bit of logic is reversed.
Title: Re: Censoring setting reversed
Post by: Burke Knight on June 10, 2015, 09:14:54 am
Looks like another confirmed bug for me. ;)

Just trying to help out, however I can, my friend. :)
Title: Re: Censoring setting reversed
Post by: emanuele on June 10, 2015, 10:51:17 am
Fixed: https://github.com/emanuele45/Dialogo/commit/18c7a49b7444fef77c9baf72aab5e607c0b8091e
And added some tests: https://github.com/emanuele45/Dialogo/commit/cff47042b4f75214e5e8c9914c0f31a73f3be6f9
Should make more difficult to break it in the future.

And of course thanks for reporting it! ;D
Title: Re: Censoring setting reversed
Post by: Burke Knight on June 10, 2015, 12:33:32 pm
Works. Thank you. :)
Title: Re: Censoring setting reversed
Post by: emanuele on June 10, 2015, 02:51:46 pm
Once in I while I'm able to actually fix something! :P