net/haproxy: decode HTML entities when exporting data

This commit is contained in:
Frank Wall 2016-04-19 11:34:33 +02:00
parent 34edf62f22
commit 2050ac7cb9
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ if (isset($configObj->OPNsense->HAProxy->errorfiles)) {
$ef_name = (string)$errorfile->name;
$ef_id = (string)$errorfile->id;
if ($ef_id != "") {
$ef_content = str_replace("\n\n", "\n", str_replace("\r", "", (string)$errorfile->content));
$ef_content = htmlspecialchars_decode(str_replace("\r", "", (string)$errorfile->content));
$ef_filename = "/var/etc/haproxy/errorfiles/" . $ef_id . ".txt" ;
file_put_contents($ef_filename, $ef_content);
chmod($ef_filename, 0600);

View file

@ -47,7 +47,7 @@ if (isset($configObj->OPNsense->HAProxy->luas)) {
$lua_name = (string)$lua->name;
$lua_id = (string)$lua->id;
if ($lua_id != "") {
$lua_content = str_replace("\n\n", "\n", str_replace("\r", "", (string)$lua->content));
$lua_content = htmlspecialchars_decode(str_replace("\r", "", (string)$lua->content));
$lua_filename = "/var/etc/haproxy/lua/" . $lua_id . ".lua" ;
file_put_contents($lua_filename, $lua_content);
chmod($lua_filename, 0600);