diff options
author | Andrew Dolgov <[email protected]> | 2013-03-30 10:14:47 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-30 10:14:47 +0400 |
commit | c93f98e1231b5fcdd0cac334df50998f36314510 (patch) | |
tree | eec75579c86ce06409177e150d0d422a77843dd3 | |
parent | f0d7c1ac86bfa39812339440d8d193399c71bde5 (diff) |
installer: do not create unneeded blank line at the end of config.php
-rw-r--r-- | install/index.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/install/index.php b/install/index.php index ba71bbdba..6e141f077 100644 --- a/install/index.php +++ b/install/index.php @@ -114,6 +114,8 @@ $rv = ""; + $finished = false; + foreach ($data as $line) { if (preg_match("/define\('DB_TYPE'/", $line)) { $rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n"; @@ -129,9 +131,13 @@ $rv .= "\tdefine('DB_PORT', '$DB_PORT');\n"; } else if (preg_match("/define\('SELF_URL_PATH'/", $line)) { $rv .= "\tdefine('SELF_URL_PATH', '$SELF_URL_PATH');\n"; - } else { + } else if (!$finished) { $rv .= "$line\n"; } + + if (preg_match("/\?\>/", $line)) { + $finished = true; + } } return $rv; |