Has anyone else ran into this?

I've added several words to my whitelist but they are still being filtered? How can I get around this?

Comments

accessiveapps’s picture

Assigned: Unassigned » accessiveapps
SteveMushynsky’s picture

Issue summary: View changes

I have same problem after installing 7.x-2.0. This makes this module unusable

damienmckenna’s picture

Version: 6.x-1.1 » 7.x-2.0

Can you please install the Devel module and change _phonetic_apply_filter() to something like the following?

function _phonetic_apply_filter($text) {
  // Load the words blacklist.
  $blacklist = variable_get('phonetic_blacklist', '');
  if (!is_array($blacklist)) {
    $blacklist = explode("\n", $blacklist);
  }
  dpm($blacklist);

  // Load the whitelist.
  $whitelist = variable_get('phonetic_whitelist', '');
  if (!is_array($whitelist)) {
    $whitelist = explode("\n", $whitelist);
  }
  dpm($whitelit);

  $char = variable_get('phonetic_replacement_char', '*');
  $extra_chars = variable_get('phonetic_extra_chars', '');
  $words = str_word_count(strip_tags($text), 2, $extra_chars);
  dpm($words);
...

Then, when the text is filtered, you'll see three arrays output on the page - please check through them to verify the items are filtered the way you're expecting.

jonanthony’s picture

Just saw this too - the answer is frustratingly simple. Any time you change the filters you MUST clear the cache. After messing around with DPMs this turned out to be a cache clear issue for me.
By the way - nice module.
jon

cravecode’s picture

StatusFileSize
new2.47 KB

I don't understand why the whitelist check is buried in the loop of the blacklisted words, It seems like a waste.

I faced the following issues related to white listed words:

  • An exact black listed match ignores the whitelist.
  • The "explode" function on the whitelist only explodes on "\n", it doesn't account for "\r\n". It leaves "\r" at the end of the word if someone from a windows machine entered the values, this returns a false negative if the word is in the white list but has a "\r" left at the end.
  • The whitelist check is case sensitive, for my use and IMHO it shouldn't be.

Attached is the patch we're currently using in our production systems to address the issues stated above. The patch was created for the 7.x-2.x branch.

Thanks for the fantastic module!

bgedney’s picture

The filter doesn't seem to be working at all...

manish.upadhyay’s picture

StatusFileSize
new595 bytes

White list is not working because some times it has space within the white list word that is not handled properly so try using attached patch.

manish.upadhyay’s picture

manish.upadhyay’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new595 bytes

This patch worked for me.

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs review
manish.upadhyay’s picture

Status: Needs review » Fixed
manish.upadhyay’s picture

Status: Fixed » Closed (fixed)