fix: Revert to using addslashes() for template parsing in alerts (#6661)

* fix: Revert to using addslashes() for template parsing in alerts

* Update alerts.inc.php
This commit is contained in:
Neil Lathwood
2017-05-17 20:11:54 +01:00
committed by GitHub
parent 21d205b379
commit bfa26b8634

View File

@@ -322,7 +322,7 @@ function GetContacts($results)
function FormatAlertTpl($obj)
{
$tpl = $obj["template"];
$msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), str_replace("'", "\'", $tpl)).'";';
$msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($tpl)).'";';
$parsed = $msg;
$s = strlen($msg);
$x = $pos = -1;