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
Branches
No related tags found
No related merge requests found
...@@ -92,9 +92,9 @@ class Mailer { ...@@ -92,9 +92,9 @@ class Mailer {
require_once (PEAR_DIR.'Mail/mime.php'); // PEAR Mail_Mime packge require_once (PEAR_DIR.'Mail/mime.php'); // PEAR Mail_Mime packge
//do some cleanup //do some cleanup
$to=preg_replace("/(\r\n|\r|\n)/s",'', trim($to)); $to = preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
$subject=stripslashes(preg_replace("/(\r\n|\r|\n)/s",'', trim($subject))); $subject = preg_replace("/(\r\n|\r|\n)/s",'', trim($subject));
$body = stripslashes(preg_replace("/(\r\n|\r)/s", "\n", trim($message))); $body = preg_replace("/(\r\n|\r)/s", "\n", trim($message));
/* Message ID - generated for each outgoing email */ /* Message ID - generated for each outgoing email */
$messageId = sprintf('<%s%d-%s>', Misc::randCode(6), time(), $messageId = sprintf('<%s%d-%s>', Misc::randCode(6), time(),
......
...@@ -98,7 +98,7 @@ class VariableReplacer { ...@@ -98,7 +98,7 @@ class VariableReplacer {
if(!($vars=$this->_parse($input))) if(!($vars=$this->_parse($input)))
return $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) { function _resolveVar($var) {
...@@ -134,14 +134,5 @@ class VariableReplacer { ...@@ -134,14 +134,5 @@ class VariableReplacer {
return $vars; 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.
Please register or to comment