diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-30 20:23:03 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-30 20:23:39 +0200 |
commit | e89a4b3a0d3d736abccfc3c7e6e1855ea4637580 (patch) | |
tree | 7c0a661ca6d8b3d3110f302b07c21019c05b7d7a /files/index.php | |
parent | 5700d8d6b16c7953081a5b360b5c6a4d3403019e (diff) | |
download | nextcloud-server-e89a4b3a0d3d736abccfc3c7e6e1855ea4637580.tar.gz nextcloud-server-e89a4b3a0d3d736abccfc3c7e6e1855ea4637580.zip |
Fix bug: filenames in filelisting are not shown for files without extension
patch by Elias Probst
Diffstat (limited to 'files/index.php')
-rw-r--r-- | files/index.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/files/index.php b/files/index.php index 059546391b6..3d62c3385fa 100644 --- a/files/index.php +++ b/files/index.php @@ -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']=''; |