[BUGFIX] TypoScript: Unify line-endings to LF on save 39/35839/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 6 Jan 2015 01:48:10 +0000 (02:48 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 11 Jan 2015 10:01:58 +0000 (11:01 +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/35839
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php

index 01be093..b0ac47b 100644 (file)
@@ -119,13 +119,12 @@ class TypoScriptTemplateInfoHook {
                                                foreach ($POST['data'] as $field => $val) {
                                                        switch ($field) {
                                                                case 'constants':
-
                                                                case 'config':
-
+                                                                       // Replace Windows- and Mac linebreaks
+                                                                       $val = str_replace(array(CRLF, CR), LF, $val);
+                                                                       // intended fallthrough
                                                                case 'title':
-
                                                                case 'sitetitle':
-
                                                                case 'description':
                                                                        $recData['sys_template'][$saveId][$field] = $val;
                                                                        break;