Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update
  • Loading branch information
peter-mw committed Jul 6, 2022
1 parent 80035ef commit 5850057
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -22,10 +22,10 @@ public function listFiles(Request $request) {

$order = $request->get('order', 'asc');
$orderBy = $request->get('orderBy', 'modified');
$path = urldecode($path);

$path = str_replace('./', '', $path);
$path = str_replace('..', '', $path);
$path = urldecode($path);
$path = str_replace($pathRestirct, '', $path);

$thumbnailSize = 150;
Expand Down Expand Up @@ -72,12 +72,14 @@ public function listFiles(Request $request) {
if ($ext == 'jpg' or $ext == 'png' or $ext == 'gif' or $ext == 'jpeg' or $ext == 'bmp') {
$thumbnail = thumbnail(mw()->url_manager->link_to_file($file), $thumbnailSize, $thumbnailSize, true);
}
$relative_path = str_ireplace(base_path(), '', $file);


$data[] = [
'type'=>'file',
'mimeType'=> mime_content_type($file),
'name'=> basename($file),
'path'=> $file,
'path'=> $relative_path,
'created'=> date('Y-m-d H:i:s',filectime($file)),
'modified'=> date('Y-m-d H:i:s',filemtime($file)),
'thumbnail'=> $thumbnail,
Expand Down

0 comments on commit 5850057

Please sign in to comment.