Do not output unescaped chars to generated configuration file.

This commit is contained in:
Michal Čihař
2009-03-24 08:34:23 +00:00
parent 0d4adbfc19
commit 460a649dbc

View File

@@ -573,6 +573,7 @@ function get_cfg_string($cfg) {
foreach ($c['Servers'] as $cnt => $srv) {
$ret .= $crlf . '/* Server ' . strtr(get_server_name($srv, $cnt, false), '*', '-') . " */$crlf\$i++;" . $crlf;
foreach ($srv as $key => $val) {
$key = preg_replace('/[^A-Za-z0-9_]/', '_', $key);
$ret .= get_cfg_val("\$cfg['Servers'][\$i]['$key']", $val);
}
}
@@ -581,6 +582,7 @@ function get_cfg_string($cfg) {
unset($c['Servers']);
foreach ($c as $key => $val) {
$key = preg_replace('/[^A-Za-z0-9_]/', '_', $key);
$ret .= get_cfg_val("\$cfg['$key']", $val);
}