From 2050ac7cb9e7e8dc39d82903b2de4536b77f841f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 19 Apr 2016 11:34:33 +0200 Subject: [PATCH] net/haproxy: decode HTML entities when exporting data --- .../src/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php | 2 +- .../src/opnsense/scripts/OPNsense/HAProxy/exportLuaScripts.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php index 024162451..ce82cf8c0 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php @@ -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); diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportLuaScripts.php b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportLuaScripts.php index 599bb5212..04ac6aaca 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportLuaScripts.php +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportLuaScripts.php @@ -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);