]> git.wh0rd.org Git - tt-rss.git/commitdiff
installer: do not create unneeded blank line at the end of config.php
authorAndrew Dolgov <fox@fakecake.org>
Sat, 30 Mar 2013 06:14:47 +0000 (10:14 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Sat, 30 Mar 2013 06:14:47 +0000 (10:14 +0400)
install/index.php

index ba71bbdbaedbeb3d943a346e1796bd970938816a..6e141f077c3c7c7884aefa72a8b4842f20a989ef 100644 (file)
 
                $rv = "";
 
+               $finished = false;
+
                foreach ($data as $line) {
                        if (preg_match("/define\('DB_TYPE'/", $line)) {
                                $rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n";
                                $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;