Merge pull request #162 from bergware/6.4-wip

Corrected invalid links in Browse function
This commit is contained in:
tom mortensen
2017-09-04 08:18:17 -07:00
committed by GitHub
4 changed files with 7 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ Tag="navicon"
<style>.loc{text-align:left;white-space:nowrap}</style>
<script>
$(function(){
$.get('/webGui/include/Browse.php',{dir:"<?=addslashes(htmlspecialchars($dir))?>",path:"<?=$path?>",user:<?=strpos($dir,'/mnt/user')===0?1:0?>},function(data){
$.get('/webGui/include/Browse.php',{dir:"<?=addslashes(urlencode($dir))?>",path:"<?=$path?>",user:<?=strpos($dir,'/mnt/user')===0?1:0?>},function(data){
var table = $('table.indexer');
var col = $.cookie('col')||1;
var dir = $.cookie('dir')||0;

View File

@@ -120,7 +120,7 @@ Certificate info:
> `server:`<br>
> `private-domain: "unraid.net"`
> **Ubiquiti UGS router:** you can add this configuration line:
> **Ubiquiti USG router:** you can add this configuration line:
> `set service dns forwarding options rebind-domain-ok=/unraid.net/`

View File

@@ -17,14 +17,14 @@ require_once "$docroot/webGui/include/Helpers.php";
function parent_link() {
global $dir,$path;
return ($dir && dirname($dir)!='/' && dirname($dir)!='/mnt' && dirname($dir)!='/mnt/user')
? "<a href=\"".htmlspecialchars("/$path?dir=".urlencode_path(dirname($dir)))."\">Parent Directory...</a>" : "";
? "<a href=\"/$path?dir=".htmlspecialchars(urlencode_path(dirname($dir)))."\">Parent Directory</a>" : "";
}
function trim_slash($url){
return preg_replace('/\/\/+/','/',$url);
}
extract(parse_plugin_cfg('dynamix',true));
$disks = parse_ini_file('state/disks.ini',true);
$dir = $_GET['dir'];
$dir = urldecode($_GET['dir']);
$path = $_GET['path'];
$user = $_GET['user'];
$list = [];
@@ -76,7 +76,7 @@ foreach ($list as $row) {
if ($row['type']=='directory') {
echo "<tr>";
echo "<td data=''><div class='icon-folder'></div></td>";
echo "<td><a href=\"".htmlspecialchars("/$path?dir=".urlencode_path(trim_slash($dir.'/'.$row['name'])))."\">".htmlspecialchars($row['name'])."</a></td>";
echo "<td><a href=\"/$path?dir=".htmlspecialchars(urlencode_path(trim_slash($dir.'/'.$row['name'])))."\">".htmlspecialchars($row['name'])."</a></td>";
echo "<td data='0'>&lt;DIR&gt;</td>";
echo "<td data='{$row['time']}'>".my_time($row['time'],"%F {$display['time']}")."</td>";
echo "<td class='loc'>{$row['disk']}</td>";
@@ -87,7 +87,7 @@ foreach ($list as $row) {
$tag = strpos($row['disk'],',')===false ? '' : 'warning';
echo "<tr>";
echo "<td data='{$row['fext']}'><div class='icon-file icon-{$row['fext']}'></div></td>";
echo "<td><a href=\"".htmlspecialchars(urlencode_path(trim_slash($dir.'/'.$row['name'])))."\" class=\"".($tag?:'none')."\">".htmlspecialchars($row['name'])."</a></td>";
echo "<td><a href=\"".htmlspecialchars(trim_slash($dir.'/'.$row['name']))."\" class=\"".($tag?:'none')."\">".htmlspecialchars($row['name'])."</a></td>";
echo "<td data='{$row['size']}' class='$tag'>".my_scale($row['size'],$unit)." $unit</td>";
echo "<td data='{$row['time']}' class='$tag'>".my_time($row['time'],"%F {$display['time']}")."</td>";
echo "<td class='loc $tag'>{$row['disk']}</td>";

View File

@@ -74,7 +74,7 @@ function device_browse(&$disk) {
}
function device_desc(&$disk) {
global $var;
$size = my_scale($disk['size']*1024,$unit);
$size = my_scale($disk['size'] ? $disk['size']*1024 : $disk['sectors']*$disk['sector_size'],$unit);
$log = $var['fsState']=='Started' ? "<a href=\"#\" title=\"Disk Log Information\" onclick=\"openBox('/webGui/scripts/disk_log&arg1={$disk['device']}','Disk Log Information',600,900,false);return false\"><i class=\"fa fa-hdd-o icon\"></i></a>" : "";
return $log.my_id($disk['id'])." - $size $unit ({$disk['device']})";
}