Escape single quotes and backslashes

This commit is contained in:
Philipp 2023-01-03 15:36:36 +01:00
parent 65d79d4c93
commit dd88d193b9
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 10 additions and 3 deletions

View file

@ -75,7 +75,7 @@ class ConfigFileTransformer
} elseif (is_numeric($value)) {
$string .= $value . ",";
} else {
$string .= sprintf('\'%s\',', $value);
$string .= sprintf('\'%s\',', addcslashes($value, '\'\\'));
}
$string .= PHP_EOL;