• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
directory_map function in directory helper skips directory with name "0"

#1
[eluser]Unknown[/eluser]
system/helpers/directory_helper.php:55 has code:
Code:
// Remove '.', '..', and hidden files [optional]
if ( ! trim($file, '.') OR ($hidden == FALSE && $file[0] == '.'))
{
continue;
}


If directory has the name exact "0", trim returns 0, and function skips this directory.
Thinking it is wrong, I found a fix:

Code:
if (strlen(trim($file, '.'))==0 OR ($hidden == FALSE && $file[0] == '.')) {
continue;
}
Please advice whether this is a bug and should this fix be promoted to CI codebase.

Regards, Irina


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.