mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Fix. Do not populate invalid paths. (#1585)
Problem when `opendir($dir)` returns `false` and then while cycle adds many empty strings which produce in the end ``` /etc/freeswitch/tls /etc/freeswitch/tls/ /etc/freeswitch/tls// /etc/freeswitch/tls/// /etc/freeswitch/tls//// /etc/freeswitch/tls///// /etc/freeswitch/tls////// /etc/freeswitch/tls/////// ```
This commit is contained in:
committed by
FusionPBX
parent
f1c31e0935
commit
937821da68
@@ -45,7 +45,7 @@ else {
|
||||
$htmlfilelist = '';
|
||||
$dirlist = opendir($dir);
|
||||
$dir_array = array();
|
||||
while (false !== ($file = readdir($dirlist))) {
|
||||
if($dirlist !== false) while (false !== ($file = readdir($dirlist))) {
|
||||
if ($file != "." AND $file != ".."){
|
||||
$newpath = $dir.'/'.$file;
|
||||
$level = explode('/',$newpath);
|
||||
|
||||
@@ -49,7 +49,7 @@ else {
|
||||
$htmlfilelist = '';
|
||||
$dirlist = opendir($dir);
|
||||
$dir_array = array();
|
||||
while (false !== ($file = readdir($dirlist))) {
|
||||
if($dirlist !== false) while (false !== ($file = readdir($dirlist))) {
|
||||
if ($file != "." AND $file != ".."){
|
||||
$newpath = $dir.'/'.$file;
|
||||
$level = explode('/',$newpath);
|
||||
|
||||
Reference in New Issue
Block a user