ok, i know this is cheating

lines 405 - 432 :
//function mosReadDirectory( $path, $filter='.', $recurse=false, $fullpath=false ) {
// $arr = array();
// if (!@is_dir( $path )) {
// return $arr;
// }
// $handle = opendir( $path );
//
// while ($file = readdir($handle)) {
// $dir = JPath::clean( $path.'/'.$file, false );
// $isDir = is_dir( $dir );
// if (($file != ".") && ($file != "..")) {
// if (preg_match( "/$filter/", $file )) {
// if ($fullpath) {
// $arr[] = trim( mosPathName( $path.'/'.$file, false ) );
// } else {
// $arr[] = trim( $file );
// }
// }
// if ($recurse && $isDir) {
// $arr2 = mosReadDirectory( $dir, $filter, $recurse, $fullpath );
// $arr = array_merge( $arr, $arr2 );
// }
// }
// }
// closedir($handle);
// asort($arr);
// return $arr;
//}
So far everything, everything I've tested, is working just fine...