Closed (fixed)
Project:
Mailhandler
Version:
6.x-2.x-dev
Component:
Mailhandler
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2012 at 14:05 UTC
Updated:
23 May 2012 at 22:00 UTC
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
Comment #1
danepowell commentedWhat commands are you issuing? I'm guessing one of your commands has a special character (such as a slash) in it.
Comment #2
rsbecker commentedIt is a taxonomy term with a slash in it. The term is in brackets -- [legal/enforcement]. Do I have to change the tEr?
Comment #3
danepowell commentedYou 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.
Comment #4
rsbecker commentedWould it work if the / is escaped, i.e. legal\/enforcement?
Comment #5
danepowell commentedI'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
Comment #6
danepowell commentederm... I guess I fixed this in 7.x-2.x but not in 6.x-2.x.
Comment #7
danepowell commentedhttp://drupalcode.org/project/mailhandler.git/commit/132fd2e