[TYPO3-core] RFC: Respect target if specified in file header

Michael Stucki michael at typo3.org
Fri Dec 2 00:05:44 CET 2005


Martin Kutschker wrote:

>> >+ // Get the first two lines of the file
>> >+
>> > preg_match('/^.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r][^\n\r]*/'
$content,
>> > $match);
>> 
>> These are more than two lines.
> 
> And it might be an idea to do a substr($content,0,1024) to avoid problems
> with binary files.
> 
> Which brings up the idea of restricting the tests on known file
> extensions.

OK, changed that. Attached is a new patch that contains all suggestions so
far. It only proceeds on html,tmpl,xml,css files so far. However it still
can't be disabled generally (see below).

Interestingly nobody noticed that the patch was not working if the backend
was ISO-8859-1 and t3lib_div::readLLXMLfile() converts the content to this
instead of UTF-8 which is used internally. However this is also fixed now.

One note about disabling this feature:
Imagine a setup that uses ISO-8859-1 and the admin wants to edit the
locallang.xml of a random extension. If it contains special characters, he
will fail.

I think that this function provides a good way to edit content in a mixed
charset environment, plus it will not slow things down a lot because
template and language files are all cached.

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: csconvert_v2.diff
Type: text/x-diff
Size: 5934 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20051202/623d77db/attachment.bin 


More information about the TYPO3-team-core mailing list