Update common.php
This commit is contained in:
+5
-6
@@ -859,7 +859,7 @@ function splitlast($str, $split)
|
||||
$tmp[1] = substr($str, $pos+1);
|
||||
} else {
|
||||
$tmp[0] = '';
|
||||
$tmp[1] = $str;
|
||||
$tmp[1] = substr($str, 1);
|
||||
}
|
||||
return $tmp;
|
||||
}
|
||||
@@ -941,10 +941,9 @@ function fetch_files($path = '/')
|
||||
// https://docs.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0
|
||||
// https://docs.microsoft.com/zh-cn/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http
|
||||
// https://developer.microsoft.com/zh-cn/graph/graph-explorer
|
||||
$pos = strrpos($path, '/');
|
||||
if ($pos>1) {
|
||||
$parentpath = substr($path, 0, $pos);
|
||||
$filename = strtolower(substr($path, $pos+1));
|
||||
$pos = splitlast($path, '/');
|
||||
$parentpath = $pos[0];
|
||||
$filename = $pos[1];
|
||||
if ($parentfiles = getcache('path_' . $parentpath. '/')) {
|
||||
if (isset($parentfiles['children'][$filename]['@microsoft.graph.downloadUrl'])) {
|
||||
if (in_array(splitlast($filename,'.')[1], $exts['txt'])) {
|
||||
@@ -957,7 +956,7 @@ function fetch_files($path = '/')
|
||||
return $parentfiles['children'][$filename];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$url = $_SERVER['api_url'];
|
||||
if ($path !== '/') {
|
||||
$url .= ':' . $path;
|
||||
|
||||
Reference in New Issue
Block a user