Fixed bug #2642: Bug: Directories named 0 break directory listing and you cannnot...
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 1 Sep 2008 16:57:58 +0000 (16:57 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 1 Sep 2008 16:57:58 +0000 (16:57 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4046 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php
t3lib/class.t3lib_extfilefunc.php
typo3/class.file_list.inc

index 434b18b..a3964d7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed bug #8508: String "Important Notice" in About Modules is hardcoded
        * Fixed bug #2222: CSH missing for localization settings of pages (thanks to Christian Kuhn)
        * Fixed bug #9249: Misspelling in Install tool (thanks to Christian Kuhn)
+       * Fixed bug #2642: Bug: Directories named 0 break directory listing and you cannnot create a directory with name 0 (thanks to Rob Vonk & Christian Kuhn)
 
 2008-08-30  Stanislas Rolland  <typo3@sjbr.ca>
 
index c77e0e0..d2ac055 100755 (executable)
@@ -2847,7 +2847,7 @@ final class t3lib_div {
                if ($path)      {
                        $d = @dir($path);
                        if (is_object($d))      {
-                               while($entry=$d->read()) {
+                               while(false !== ($entry=$d->read())) {
                                        if (@is_dir($path.'/'.$entry) && $entry!= '..' && $entry!= '.') {
                                                $filearray[]=$entry;
                                        }
@@ -5167,4 +5167,4 @@ final class t3lib_div {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 72fc81d..dae86ec 100755 (executable)
@@ -696,7 +696,7 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions       {
                if (!$this->isInit) return FALSE;
 
                $theFolder = $this->cleanFileName($cmds['data']);
-               if ($theFolder) {
+               if (isset($theFolder))  {
                        if ($this->checkFileNameLen($theFolder))        {
                                $theTarget = $this->is_directory($cmds['target']);      // Check the target dir
                                if ($theTarget) {
index c1eea10..dbe5798 100755 (executable)
@@ -564,7 +564,7 @@ class fileList extends t3lib_recordList {
                        $d = @dir($path);
                        $tempArray=Array();
                        if (is_object($d))      {
-                               while($entry=$d->read()) {
+                               while(false !== ($entry=$d->read())) {
                                        if ($entry!='.' && $entry!='..')        {
                                                $wholePath = $path.'/'.$entry;          // Because of odd PHP-error where  <br />-tag is sometimes placed after a filename!!
                                                if (@file_exists($wholePath) && (!$type || t3lib_div::inList($type,filetype($wholePath))))      {