Browse files

Fixed several bugs related with readdir problem. If the directory con…

…tains a file named '0', the iteration would quit prematurely.
  • Loading branch information...
1 parent a6cf02e commit bf91ad01d5c173721d8d28597e8087dc856c823e qiang.xue committed Feb 7, 2010
View
1 CHANGELOG
@@ -12,6 +12,7 @@ Version 1.0.12 to be released
- Bug #843: CApcCache::mget() may fail if some entries of the specified keys are not cached (Qiang)
- Bug: CVarDumper sometimes doesn't dump object value correctly (Qiang)
- Bug: COciSchema::findTableNames() should use upper case for the keys of query results (Qiang)
+- Bug: Fixed several bugs related with readdir problem. If the directory contains a file named '0', the iteration would quit prematurely. (Qiang)
- Enh #730: Relational queries now respect changes made to CActiveRecord::dbCriteria in the onBeforeFind event (Qiang)
- Enh #737: CUrlManager::createUrl() now supports multidimensional array params (Jonah)
- Enh #757: Allow CDbCriteria::addInCondition() to use parameter array that is not integer-indexed (Qiang)
View
2 framework/caching/CFileCache.php
@@ -202,7 +202,7 @@ protected function gc($expiredOnly=true,$path=null)
$path=$this->cachePath;
if(($handle=opendir($path))===false)
return;
- while($file=readdir($handle))
+ while(($file=readdir($handle))!==false)
{
if($file[0]==='.')
continue;
View
2 framework/console/CConsoleCommand.php
@@ -192,7 +192,7 @@ public function buildFileList($sourceDir, $targetDir, $baseDir='')
{
$list=array();
$handle=opendir($sourceDir);
- while($file=readdir($handle))
+ while(($file=readdir($handle))!==false)
{
if($file==='.' || $file==='..' || $file==='.svn')
continue;
View
2 framework/console/CConsoleCommandRunner.php
@@ -80,7 +80,7 @@ public function findCommands($path)
if(($dir=@opendir($path))===false)
return array();
$commands=array();
- while($name=readdir($dir))
+ while(($name=readdir($dir))!==false)
{
$file=$path.DIRECTORY_SEPARATOR.$name;
if(!strcasecmp(substr($name,-11),'Command.php') && is_file($file))
View
2 framework/i18n/CLocale.php
@@ -52,7 +52,7 @@ public static function getLocaleIDs()
$locales=array();
$dataPath=dirname(__FILE__).DIRECTORY_SEPARATOR.'data';
$folder=@opendir($dataPath);
- while($file=@readdir($folder))
+ while(($file=@readdir($folder))!==false)
{
$fullPath=$dataPath.DIRECTORY_SEPARATOR.$file;
if(substr($file,-4)==='.php' && is_file($fullPath))
View
4 framework/utils/CFileHelper.php
@@ -96,7 +96,7 @@ protected static function copyDirectoryRecursive($src,$dst,$base,$fileTypes,$exc
@mkdir($dst);
@chmod($dst,0777);
$folder=opendir($src);
- while($file=readdir($folder))
+ while(($file=readdir($folder))!==false)
{
if($file==='.' || $file==='..')
continue;
@@ -133,7 +133,7 @@ protected static function findFilesRecursive($dir,$base,$fileTypes,$exclude,$lev
{
$list=array();
$handle=opendir($dir);
- while($file=readdir($handle))
+ while(($file=readdir($handle))!==false)
{
if($file==='.' || $file==='..')
continue;
View
2 framework/web/CThemeManager.php
@@ -75,7 +75,7 @@ public function getThemeNames()
$themes=array();
$basePath=$this->getBasePath();
$folder=@opendir($basePath);
- while($file=@readdir($folder))
+ while(($file=@readdir($folder))!==false)
{
if($file!=='.' && $file!=='..' && $file!=='.svn' && is_dir($basePath.DIRECTORY_SEPARATOR.$file))
$themes[]=$file;

0 comments on commit bf91ad0

Please sign in to comment.