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:
parent
f828c1c56b
commit
840ea3faa4
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue