I just installed the 1/18 dev release and I'm getting the following error on import of messages:

warning: preg_replace() [function.preg-replace]: Unknown modifier 'E' in /home/dcogco5/public_html/drupal/sites/all/modules/mailhandler/plugins/mailhandler/commands/MailhandlerCommandsDefault.class.php on line 27.

The relevant code appears to be:

    $commands = $this->getCommands($message['body_text']);
    $this->commands = $commands;
    foreach ($commands as $key => $value) {
      $message['body_html'] = preg_replace('/' . $key . ': ' . $value . '/', '', $message['body_html'], 1);
      $message['body_html'] = preg_replace('/<br[^>\r\n]*>/', '', $message['body_html'], 1);
    }

But there is no apparent modifier 'E' in the code.

Comments

danepowell’s picture

What commands are you issuing? I'm guessing one of your commands has a special character (such as a slash) in it.

rsbecker’s picture

It is a taxonomy term with a slash in it. The term is in brackets -- [legal/enforcement]. Do I have to change the tEr?

danepowell’s picture

You can change the term as a temporary workaround, but I suppose we should figure out how to make the regex more resilient to special characters.

rsbecker’s picture

Would it work if the / is escaped, i.e. legal\/enforcement?

danepowell’s picture

Title: Getting error on message import » Error message due to taxonomy terms with special characters
Status: Active » Fixed

I'm not sure why I decided to use preg_replace instead of str_replace in the first place... so I switched to str_replace, which should be resilient to special characters.

http://drupalcode.org/project/mailhandler.git/commit/7dd4969

danepowell’s picture

Status: Fixed » Patch (to be ported)

erm... I guess I fixed this in 7.x-2.x but not in 6.x-2.x.

danepowell’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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