From: Marcin Haba Date: Sun, 26 May 2019 20:42:43 +0000 (+0200) Subject: baculum: Fix #2477 escaping backslashes in config in text directive types X-Git-Tag: Release-9.4.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72b414c120c0f386ac29d478166d889b7d849d1e;p=thirdparty%2Fbacula.git baculum: Fix #2477 escaping backslashes in config in text directive types --- diff --git a/gui/baculum/protected/API/Class/BaculaSetting.php b/gui/baculum/protected/API/Class/BaculaSetting.php index 26d8a55ea..9d2a6e8c3 100644 --- a/gui/baculum/protected/API/Class/BaculaSetting.php +++ b/gui/baculum/protected/API/Class/BaculaSetting.php @@ -479,7 +479,7 @@ class BaculaSetting extends APIModule { $directive_value = $value; } elseif (is_string($value)) { if (!key_exists($resource_type, $this->unquoted_string_directives) || !in_array($directive_name, $this->unquoted_string_directives[$resource_type])) { - $value = str_replace('"', '\"', $value); + $value = addcslashes($value, '\\"'); $value = "\"$value\""; } $directive_value = $value;