@@ -56,9 +56,9 @@ |
||
| 56 | 56 | $path = $_SERVER['REQUEST_URI']; |
| 57 | 57 | $pos = strpos($path, '?'); |
| 58 | 58 | if (false === $pos) { |
| 59 | - $authStr = urldecode($path) . "\n" . $body; |
|
| 59 | + $authStr = urldecode($path)."\n".$body; |
|
| 60 | 60 | } else { |
| 61 | - $authStr = urldecode(substr($path, 0, $pos)) . substr($path, $pos, strlen($path) - $pos) . "\n" . $body; |
|
| 61 | + $authStr = urldecode(substr($path, 0, $pos)).substr($path, $pos, strlen($path) - $pos)."\n".$body; |
|
| 62 | 62 | } |
| 63 | 63 | // 验证签名 |
| 64 | 64 | $ok = openssl_verify($authStr, $authorization, $pubKey, OPENSSL_ALGO_MD5); |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | $data = []; |
| 183 | 183 | if (!empty($customData)) { |
| 184 | 184 | foreach ($customData as $key => $value) { |
| 185 | - $callbackVar['x:' . $key] = $value; |
|
| 186 | - $data[$key] = '${x:' . $key . '}'; |
|
| 185 | + $callbackVar['x:'.$key] = $value; |
|
| 186 | + $data[$key] = '${x:'.$key.'}'; |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $callbackParam = [ |
|
| 190 | + $callbackParam = [ |
|
| 191 | 191 | 'callbackUrl' => $callBackUrl, |
| 192 | 192 | 'callbackBody' => urldecode(http_build_query(array_merge($system, $data))), |
| 193 | 193 | 'callbackBodyType' => 'application/x-www-form-urlencoded', |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $expiration = $this->gmt_iso8601($end); |
| 201 | 201 | |
| 202 | 202 | // 最大文件大小.用户可以自己设置 |
| 203 | - $condition = [ |
|
| 203 | + $condition = [ |
|
| 204 | 204 | 0 => 'content-length-range', |
| 205 | 205 | 1 => 0, |
| 206 | 206 | 2 => $contentLengthRangeValue, |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $response['expire'] = $end; |
| 232 | 232 | $response['callback'] = $base64CallbackBody; |
| 233 | 233 | $response['callback-var'] = $callbackVar; |
| 234 | - $response['dir'] = $prefix; // 这个参数是设置用户上传文件时指定的前缀。 |
|
| 234 | + $response['dir'] = $prefix; // 这个参数是设置用户上传文件时指定的前缀。 |
|
| 235 | 235 | |
| 236 | 236 | return json_encode($response); |
| 237 | 237 | } |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | */ |
| 408 | 408 | public function createDir(string $dirname, Config $config) |
| 409 | 409 | { |
| 410 | - $defaultFile = trim($dirname, '/') . '/oss.txt'; |
|
| 410 | + $defaultFile = trim($dirname, '/').'/oss.txt'; |
|
| 411 | 411 | |
| 412 | 412 | return $this->write($defaultFile, '当虚拟目录下有其他文件时,可删除此文件~', $config); |
| 413 | 413 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | { |
| 454 | 454 | $path = $this->applyPathPrefix($path); |
| 455 | 455 | |
| 456 | - return $this->normalizeHost() . ltrim($path, '/'); |
|
| 456 | + return $this->normalizeHost().ltrim($path, '/'); |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /** |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $domain = $this->endpoint; |
| 576 | 576 | } |
| 577 | 577 | } else { |
| 578 | - $domain = $this->bucket . '.' . $this->endpoint; |
|
| 578 | + $domain = $this->bucket.'.'.$this->endpoint; |
|
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | if ($this->useSSL) { |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | $domain = "http://{$domain}"; |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - return rtrim($domain, '/') . '/'; |
|
| 587 | + return rtrim($domain, '/').'/'; |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |