mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
Fixed regression error in Browse function
This commit is contained in:
@@ -23,6 +23,7 @@ function sort_by($field, $opt, $show_disk) {
|
||||
// read directory contents into 'list' array
|
||||
global $docroot,$dir;
|
||||
$path = $docroot.preg_replace('/([\'" &()[\]\\\\])/','\\\\$1',$dir).'/*';
|
||||
file_put_contents('/tmp/test',$path);
|
||||
$file = array(); $disk = array(); $list = array();
|
||||
$i = 0;
|
||||
exec("shopt -s dotglob ; stat -L -c'%F|%n|%s|%Y' $path 2>/dev/null", $file);
|
||||
@@ -32,10 +33,11 @@ function sort_by($field, $opt, $show_disk) {
|
||||
$disk = array_fill(0, max(count($file),1), '');
|
||||
foreach ($file as $entry) {
|
||||
$attr = explode('|', $entry);
|
||||
$info = pathinfo($attr[1]);
|
||||
$list[] = array(
|
||||
'type' => $attr[0],
|
||||
'name' => basename($attr[1]),
|
||||
'fext' => strtolower(pathinfo($attr[1],PATHINFO_EXTENSION)),
|
||||
'name' => $info['basename'],
|
||||
'fext' => strtolower($info['extension']),
|
||||
'size' => $attr[2],
|
||||
'time' => $attr[3],
|
||||
'disk' => my_disk($disk[$i++]));
|
||||
@@ -126,7 +128,7 @@ $disk_order=($column=='disk'?$order:'A');
|
||||
$total+=$entry['size'];
|
||||
$warn = substr($entry['disk'],-1)=="*" ? ' class="warning"' : '';
|
||||
?> <td><div class="icon-file icon-<?=strtolower($entry['fext'])?>"></div></td>
|
||||
<td><a href="<?=autov(urlencode_path($dir.'/'.$entry['name']));?>" <?=$warn?$warn:'class="none"'?>><?=$entry['name']?></a></td>
|
||||
<td><a href="<?=urlencode_path(autov($dir.'/'.$entry['name']));?>" <?=$warn?$warn:'class="none"'?>><?=$entry['name']?></a></td>
|
||||
<td<?=$warn?>><?=my_scale($entry['size'],$unit).' '.$unit?></td>
|
||||
<? endif;?>
|
||||
<?if ($show_disk):?>
|
||||
|
||||
Reference in New Issue
Block a user