From 460a649dbcc47065fbf01bbc14392c3fc6ea161b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 24 Mar 2009 08:34:23 +0000 Subject: [PATCH] Do not output unescaped chars to generated configuration file. --- scripts/setup.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/setup.php b/scripts/setup.php index 435c3210b..55fdbc819 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -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); }