From 1102d4234f893b794796dc4987603b93e9506959 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 15 Jan 2021 18:32:32 +0800 Subject: [PATCH] try fix: sharepoint name is non english --- disk/Onedrive.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/disk/Onedrive.php b/disk/Onedrive.php index cd8249b..229ea3a 100644 --- a/disk/Onedrive.php +++ b/disk/Onedrive.php @@ -740,11 +740,14 @@ class Onedrive { //$sharepointSite = getConfig('sharepointSite', $this->disktag); while (substr($sharepointSite, -1)=='/') $sharepointSite = substr($sharepointSite, 0, -1); $tmp = splitlast($sharepointSite, '/'); - $sharepointname = urlencode($tmp[1]); + if ($tmp[1]==urldecode($tmp[1])) { + $sharepointname = urlencode($tmp[1]); + } else { + $sharepointname = $tmp[1]; + } $tmp = splitlast($tmp[0], '/'); - $sharepointname = $tmp[1] . '/' . $sharepointname; - if (getConfig('Driver', $this->disktag)=='Onedrive') $url = 'https://graph.microsoft.com/v1.0/sites/root:/' . $sharepointname; - if (getConfig('Driver', $this->disktag)=='OnedriveCN') $url = 'https://microsoftgraph.chinacloudapi.cn/v1.0/sites/root:/' . $sharepointname; + if (getConfig('Driver', $this->disktag)=='Onedrive') $url = 'https://graph.microsoft.com/v1.0/sites/root:/' . $tmp[1] . '/' . $sharepointname; + if (getConfig('Driver', $this->disktag)=='OnedriveCN') $url = 'https://microsoftgraph.chinacloudapi.cn/v1.0/sites/root:/' . $tmp[1] . '/' . $sharepointname; $i=0; $response = [];