mirror of
https://github.com/nextcloud/server.git
synced 2026-03-22 10:30:49 -04:00
Fix bug: filenames in filelisting are not shown for files without extension
patch by Elias Probst
This commit is contained in:
parent
5700d8d6b1
commit
e89a4b3a0d
1 changed files with 8 additions and 2 deletions
|
|
@ -47,8 +47,14 @@ $files = array();
|
|||
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
|
||||
$i["date"] = OC_Util::formatDate($i["mtime"] );
|
||||
if($i['type']=='file'){
|
||||
$i['extention']=substr($i['name'],strrpos($i['name'],'.'));
|
||||
$i['basename']=substr($i['name'],0,strrpos($i['name'],'.'));
|
||||
$fileinfo=pathinfo($i['name']);
|
||||
$i['basename']=$fileinfo['filename'];
|
||||
if (!empty($fileinfo['extension'])) {
|
||||
$i['extention']='.' . $fileinfo['extension'];
|
||||
}
|
||||
else {
|
||||
$i['extention']='';
|
||||
}
|
||||
}
|
||||
if($i['directory']=='/'){
|
||||
$i['directory']='';
|
||||
|
|
|
|||
Loading…
Reference in a new issue