[BUGFIX] Configuration Tool creates invalid extTables.php file
authorMarkus Klein <klein.t3@mfc-linz.at>
Wed, 6 Apr 2011 09:44:24 +0000 (11:44 +0200)
committerOliver Hader <oliver@typo3.org>
Mon, 11 Apr 2011 14:36:06 +0000 (16:36 +0200)
If extTables.php is empty or not present, this changes takes care of
adding an extra LF after the opening <?php tag.

Change-Id: Ie9b94c75cd33c5a448c2e04759b38558ca1b8845
Resolves: #25781
Releases: 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/1474
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Jan Loderhose
Tested-by: Jan Loderhose
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/lowlevel/config/index.php

index c7383b8..f71ad62 100755 (executable)
@@ -285,7 +285,8 @@ class SC_mod_tools_config_index {
                                }
 
                                        // insert line in extTables.php
-                               $extTables = '<?php' . preg_replace('/<\?php|\?>/is', '', $extTables) . $changedLine . LF . '?>';
+                               $extTables = preg_replace('/<\?php|\?>/is', '', $extTables);
+                               $extTables = '<?php' . (empty($extTables) ? LF : '') . $extTables . $changedLine . LF . '?>';
                                $success = t3lib_div::writeFile(PATH_typo3conf . TYPO3_extTableDef_script, $extTables);
                                if ($success) {
                                                // show flash message