mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/haproxy: decode HTML entities when exporting data
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user