bug fix
This commit is contained in:
parent
c062433e9b
commit
a988babb77
1 changed files with 2 additions and 4 deletions
6
sync.php
6
sync.php
|
|
@ -123,20 +123,18 @@ function getFileArray($foldername) {
|
|||
GLOBAL $localDir, $skip_filetype, $tempFilesArray;
|
||||
|
||||
$dirhandle = @opendir($foldername); //öppnar mappen
|
||||
$temp = 0;
|
||||
if($dirhandle !== false){ //gick det att öppna mappen?
|
||||
while($filename = readdir($dirhandle)){ //loopar igenom alla filer i mappen
|
||||
$filepath = $foldername ."/". $filename;
|
||||
if($temp>1 && is_dir($filepath)){ //är det en mapp?
|
||||
if($filename != "." && $filename != ".." && is_dir($filepath)){ //är det en mapp?
|
||||
getFileArray($filepath);
|
||||
}
|
||||
else{ // its a file
|
||||
else{ // its a file
|
||||
$filetype = ereg_replace("^.+\\.([^.]+)$", "\\1", $filename);
|
||||
if (!in_array($filetype, $skip_filetype)) {
|
||||
$tempFilesArray[] = array(filemtime($filepath),str_replace($localDir, "", $filepath),("http://".$_SERVER['SERVER_NAME'].str_replace("sync.php","",$_SERVER['SCRIPT_NAME']).$filepath),$filename);
|
||||
}
|
||||
}
|
||||
$temp++;
|
||||
}
|
||||
}
|
||||
return $tempFilesArray;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue