]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix #2477 escaping backslashes in config in text directive types
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 26 May 2019 20:42:43 +0000 (22:42 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 27 May 2019 04:55:54 +0000 (06:55 +0200)
gui/baculum/protected/API/Class/BaculaSetting.php

index 26d8a55ea6c587432cb29051592c180364c57c1d..9d2a6e8c39ad75c0904900cb926131b7f5bb4c04 100644 (file)
@@ -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;