mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 00:37:42 +02:00
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
This commit is contained in:
@@ -154,14 +154,11 @@ class emailer
|
|||||||
$$key = $val;
|
$$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.
|
// 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,
|
// We now try and pull a subject from the email body ... if it exists,
|
||||||
@@ -170,7 +167,7 @@ class emailer
|
|||||||
$match = array();
|
$match = array();
|
||||||
preg_match("/^(Subject:(.*?)[\r\n]+?)?(.*?)$/is", $this->msg, $match);
|
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]);
|
$this->subject = ( $this->subject != '' ) ? $this->subject : trim($match[2]);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user