[TYPO3-core] RFC #2642: Bug: Directories named 0 break directory listing and you cannnot create a directory with name 0

Christian Kuhn lolli at schwarzbu.ch
Sat Aug 30 17:11:28 CEST 2008


Hi,

Rob Vonk wrote:
> This is an SVN patch request.
> 
> Type: Bug
> 
> Bugtracker references:
> 
> http://bugs.typo3.org/view.php?id=2642
> 
> Branches: Trunk
> 
> Problem:
> 
> If a folder contains a subfolder which has a name '0' (zero) readdir 
> fails to read directory. You cannot create a directory with name '0' 
> (zero).
> 
> Solution:
> 
> Use this method of reading the directory: while (false !== ($entry = 
> $d->read())) instead of: while($entry=$d->read())
> 
> Use this method to check if directory is entered: if (isset($theFolder)) 
> instead of: if ($theFolder)


+1 based on reading and testing.

This is a happy little gremlin. Thanks for the patch Rob.

There is a similar problem in t3lib_div::get_dirs() that triggered the 
error in the foldertree, too. Attached patch fixes this and merges your 
two patch files into one.

How to test:
- Try to create a folder named "0" in the backend -> fails
- Create a folder manually and try to see it in the file list module -> 
fails in both frames (folder tree and file listing).


Thanks
Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 2642.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080830/0fef70f3/attachment.txt 


More information about the TYPO3-team-core mailing list