[BUGFIX] TypoScript: Unify line-endings to LF on save 08/35808/4
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 6 Jan 2015 01:48:10 +0000 (02:48 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Tue, 6 Jan 2015 18:15:14 +0000 (19:15 +0100)
Coding Guidelines and t3editor demand LF as line-endings.
Some browsers send CRLF (Windows) or CR (instead).

Change-Id: I264dac962cb59a568dfba1220d6962202b93a71f
Resolves: #53893
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/35808
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Frederic Gaus <gaus@flagbit.de>
Tested-by: Frederic Gaus <gaus@flagbit.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php

index a146274..c52a472 100644 (file)
@@ -120,6 +120,8 @@ class TypoScriptTemplateInfoHook {
                                                        switch ($field) {
                                                                case 'constants':
                                                                case 'config':
+                                                                       // Replace Windows- and Mac linebreaks
+                                                                       $val = str_replace([CRLF, CR], LF, $val);
                                                                        $recData['sys_template'][$saveId][$field] = $val;
                                                                        break;
                                                        }