[TYPO3-core] RFC: #9786: Remove duplicate JS-Files in backend.php

Dmitry Dulepov dmitry.dulepov at gmail.com
Thu Nov 13 09:33:38 CET 2008


Hi!

Steffen Kamper wrote:
> Problem:
> in backend.php all JS-files are collected in an array. As this isn't an
> associative array, it's possible to add duplicated files.
> 
> Solution is simple: use array_unique before writing the script-tags

Side note: I usually use file name as the array key:

$obj->jsFiles[$filename] = $filename;

It saves me one array_unique in my code.

No impact on the patch, just a note for future. We could use the
same trick in the core.

-- 
Dmitry Dulepov
TYPO3 translations support
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog:
http://typo3bloke.net/post-details/max_os_x_use_php_help_in_chm_format/


More information about the TYPO3-team-core mailing list