Skip to content
Snippets Groups Projects
Commit e123b97e authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #386 from protich/issue/384

Issue/384
parents 0a9fe20d 8ee85cd6
No related branches found
No related tags found
No related merge requests found
......@@ -92,9 +92,9 @@ class Mailer {
require_once (PEAR_DIR.'Mail/mime.php'); // PEAR Mail_Mime packge
//do some cleanup
$to=preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
$subject=stripslashes(preg_replace("/(\r\n|\r|\n)/s",'', trim($subject)));
$body = stripslashes(preg_replace("/(\r\n|\r)/s", "\n", trim($message)));
$to = preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
$subject = preg_replace("/(\r\n|\r|\n)/s",'', trim($subject));
$body = preg_replace("/(\r\n|\r)/s", "\n", trim($message));
/* Message ID - generated for each outgoing email */
$messageId = sprintf('<%s%d-%s>', Misc::randCode(6), time(),
......
......@@ -98,7 +98,7 @@ class VariableReplacer {
if(!($vars=$this->_parse($input)))
return $input;
return preg_replace($this->_delimit(array_keys($vars)), array_values($vars), $input);
return str_replace(array_keys($vars), array_values($vars), $input);
}
function _resolveVar($var) {
......@@ -134,14 +134,5 @@ class VariableReplacer {
return $vars;
}
//Helper function - will be replaced by a lambda function (PHP 5.3+)
function _delimit($val, $d='/') {
if($val && is_array($val))
return array_map(array($this, '_delimit'), $val);
return $d.$val.$d;
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment