From 0c57c20e323e72359af60fb250213673fc70a5ea Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Fri, 3 Jan 2020 17:37:50 +0800
Subject: [PATCH] Update index.php
---
index.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/index.php b/index.php
index 464ee5c..b96e7a6 100644
--- a/index.php
+++ b/index.php
@@ -157,7 +157,7 @@ function list_files($path)
if ( isset($files['folder']) || isset($files['file']) || isset($files['error']) ) {
return $files;
} else {
- error_log( $files . ' Network Error
' );
+ error_log( json_encode($files) . ' Network Error
' );
$_SERVER['retry']++;
if ($_SERVER['retry'] < 3) {
return list_files($path);
@@ -492,7 +492,7 @@ function fetch_files($path = '/')
}
$url .= '?expand=children(select=name,size,file,folder,parentReference,lastModifiedDateTime)';
$arr = curl_request($url, false, ['Authorization' => 'Bearer ' . $_SERVER['access_token']]);
- if ($arr['stat']==200) {
+ if ($arr['stat']<500) {
$files = json_decode($arr['body'], true);
// echo $path . '
' . json_encode($files, JSON_PRETTY_PRINT) . ''; if (isset($files['folder'])) { @@ -506,7 +506,7 @@ function fetch_files($path = '/') } } } else { - $files = $arr['stat'].$arr['body']; + $files = json_decode( '{"unknownError":{ "stat":'.$arr['stat'].',"message":"'.$arr['body'].'"}}', true); } } return $files;