[TYPO3-core] Gremlin #76: t3lib_div::writeFile() changespermissions without need

Martin Kutschker Martin.Kutschker at blackbox.net
Wed Oct 26 15:38:25 CEST 2005


Michael Stucki <michael at typo3.org> writes on 
Wed, 26 Oct 2005 14:53:44 +0200 (METDST):

> 
> Solution:
> 
> Check if the file exists, set a flag, and only change the permissions
> if this flag was set.


Note: you don't check for existence, but test if path points to a file. But it won't matter as fopen wil fail on directories, etc.

As for the test condition: I thought that the guidelines require bracktes even for one liners:

if (!@is_file($file)) {
$changePermissions=true;
}

Otherwise +1

Masi 



More information about the TYPO3-team-core mailing list