From: Andrew Dolgov Date: Sat, 30 Mar 2013 06:14:47 +0000 (+0400) Subject: installer: do not create unneeded blank line at the end of config.php X-Git-Tag: 1.7.6~144 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c93f98e1231b5fcdd0cac334df50998f36314510;p=tt-rss.git installer: do not create unneeded blank line at the end of config.php --- diff --git a/install/index.php b/install/index.php index ba71bbdb..6e141f07 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;