Issue Bug Closed

#53893Editing of included TypoScript file content via Backend results in wrong line endings (CRLF)

Benjamin Robinson 11/22/13, 22:11 updated 10/02/18, 12:08

Description

If an included TypoScript-file is edited in the Backend (Template -> Info/Modify -> Setup) the line breaks will be saved as CRLF. In accordance with the Coding Guidelines LF should always be used.

Precondition: t3editor (Editor with syntax highlighting) is NOT installed. The use of t3editor seems to solve this issue, but has other issues like converting tablulators to spaces.

How to reproduce the issue:
  • Create a new textfile “fileadmin/setup.ts” via Filelist
  • Include this in the Setup of a new Template:
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/setup.ts">
  • Select the “Include TypoScript file content” option
  • Enter some content (manual):
page = PAGE
page{
    10 = TEXT
    10.value = Hello World!
}
  • Save
  • View the file with a Texteditor that can display line endings (f.e. Notepad++)

The problem may be that the Browser (Firefox 25.0.1, OS X, in my case) sends the <textarea>-content with CRLF.&lt;br /&gt;A solution could be to convert all CRLF to LF before writing to the file.&lt;/p&gt; &lt;p&gt;Interesting discussion about how browsers send textarea-content: &lt;a href="http://stackoverflow.com/questions/6324167/do-browsers-send-r-n-or-n-or-does-it-depend-on-the-browser" target="_blank" rel="noreferrer"&gt;http://stackoverflow.com/questions/6324167/do-browsers-send-r-n-or-n-or-does-it-depend-on-the-browser&lt;/a&gt;&lt;/p&gt;</textarea>

Reviews 2