Skip to content

Commit

Permalink
Do not output unescaped chars to generated configuration file.
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Mar 24, 2009
1 parent 18d7934 commit e70d7b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/setup.php
Expand Up @@ -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);
}
}
Expand All @@ -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);
}

Expand Down

0 comments on commit e70d7b4

Please sign in to comment.