From ca2a956b6c72a98107048036f555a098ac449a78 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 22 Mar 2002 19:33:28 +0000 Subject: [PATCH] Alter way variables are substituted ... was causing problems when a [] followed a {VAR} in the email ... git-svn-id: file:///svn/phpbb/trunk@2407 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/emailer.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/emailer.php b/phpBB/includes/emailer.php index f54a9d4f3e..a6e8aaf5f0 100755 --- a/phpBB/includes/emailer.php +++ b/phpBB/includes/emailer.php @@ -154,14 +154,11 @@ class emailer $$key = $val; } - //$this->mailMsg = ereg_replace("]*)( )*!!>", '$this->arrPlaceHolders['."\\2".']', $this->mailMsg); - // $this->msg = ereg_replace("{( )*([^>]*)( )*}", '$'."\\2", $this->msg); - $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '$'."\\1", $this->msg); - // Escape all quotes, else the eval will fail. - $this->msg = str_replace ("\"", "\\\"", $this->msg); + $this->msg = str_replace ("'", "\'", $this->msg); + $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . $\\1 . '", $this->msg); - eval("\$this->msg = \"$this->msg\";"); + eval("\$this->msg = '$this->msg';"); // // We now try and pull a subject from the email body ... if it exists, @@ -170,7 +167,7 @@ class emailer $match = array(); preg_match("/^(Subject:(.*?)[\r\n]+?)?(.*?)$/is", $this->msg, $match); - $this->msg = ( isset($match[3]) ) ? trim($match[3]) : ""; + $this->msg = ( isset($match[3]) ) ? trim($match[3]) : ''; $this->subject = ( $this->subject != '' ) ? $this->subject : trim($match[2]); return TRUE;