framework/utils/CFileHelper.php
protected static function validatePath($base,$file,$isFile,$fileTypes,$exclude)
	{
		foreach($exclude as $e)
		{
			if($file===$e || strpos($base.'/'.$file,$e)===0)
				return false;
		}
		if(!$isFile || empty($fileTypes))
			return true;
		if(($type=self::getExtension($file))!=='')
			return in_array($type,$fileTypes);
		else
			return false;
	}
protected static function validatePath($base,$file,$isFile,$fileTypes,$exclude)
	{
		foreach($exclude as $e)
		{
			if($file===$e || strpos($base.'/'.$file,$e)===0)
				return false;
		}
		if(!$isFile || empty($fileTypes))
			return true;
		if(($type=self::getExtension($file))!=='')
			return in_array($type,$fileTypes);
		else
			return false;
	}
protected static function validatePath ( $ base , $ file , $ isFile , $ fileTypes , $ exclude ) { foreach ( $ exclude as $ e ) { if ( $ file === $ e || strpos ( $ base . '/' . $ file , $ e ) === 0 ) return false ; } if ( ! $ isFile || empty ( $ fileTypes ) ) return true ; if ( ( $ type = self :: getExtension ( $ file ) ) !== '' ) return in_array ( $ type , $ fileTypes ) ; else return false ; }
Validates a file or directory.
@param string $base the path relative to the original source directory
@param string $file the file or directory name
@param boolean $isFile whether this is a file
@param array $fileTypes list of valid file name suffixes (without dot).
@param array $exclude list of directory and file exclusions. Each exclusion can be either a name or a path.
If a file or directory name or path matches the exclusion, false will be returned. For example, an exclusion of
'.svn' will return false for all files and directories whose name is '.svn'. And an exclusion of '/a/b' will return false for
file or directory '$src/a/b'. Note, that '/' should be used as separator regardless of the value of the DIRECTORY_SEPARATOR constant.
@return boolean whether the file or directory is valid
Validates a file or directory .