Find the following code section:
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$files_array = array();
if ($dir = @dir(DIR_FS_CATALOG)) {
while ($file = $dir->read()) {
if (!is_dir(DIR_FS_CATALOG . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$files_array[] = $file;
}
}
}
sort($files_array);
$dir->close();
}
Change to:
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$files_array = array();
if ($dir = @dir(DIR_FS_CATALOG)) {
while ($file = $dir->read()) {
if ($file == '.' || $file == '..') continue;
if (!is_dir(DIR_FS_CATALOG . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$files_array[] = $file;
}
}
}
sort($files_array);
$dir->close();
}