@@ -176,14 +176,14 @@ discard block |
||
| 176 | 176 | $data = []; |
| 177 | 177 | if (!empty($customData)) { |
| 178 | 178 | foreach ($customData as $key => $value) { |
| 179 | - $callbackVar['x:' . $key] = $value; |
|
| 180 | - $data[$key] = '${x:' . $key . '}'; |
|
| 179 | + $callbackVar['x:'.$key] = $value; |
|
| 180 | + $data[$key] = '${x:'.$key.'}'; |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - $callbackParam = [ |
|
| 184 | + $callbackParam = [ |
|
| 185 | 185 | 'callbackUrl' => $callBackUrl, |
| 186 | - 'callbackBody' => 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&' . urldecode(http_build_query($data)), |
|
| 186 | + 'callbackBody' => 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&'.urldecode(http_build_query($data)), |
|
| 187 | 187 | 'callbackBodyType' => 'application/x-www-form-urlencoded', |
| 188 | 188 | ]; |
| 189 | 189 | $callbackString = json_encode($callbackParam); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $expiration = $this->gmt_iso8601($end); |
| 196 | 196 | |
| 197 | 197 | // 最大文件大小.用户可以自己设置 |
| 198 | - $condition = [ |
|
| 198 | + $condition = [ |
|
| 199 | 199 | 0 => 'content-length-range', |
| 200 | 200 | 1 => 0, |
| 201 | 201 | 2 => $contentLengthRangeValue, |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $response['expire'] = $end; |
| 227 | 227 | $response['callback'] = $base64CallbackBody; |
| 228 | 228 | $response['callback-var'] = $base64CallbackVar; |
| 229 | - $response['dir'] = $prefix; // 这个参数是设置用户上传文件时指定的前缀。 |
|
| 229 | + $response['dir'] = $prefix; // 这个参数是设置用户上传文件时指定的前缀。 |
|
| 230 | 230 | |
| 231 | 231 | return json_encode($response); |
| 232 | 232 | } |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | public function createDir($dirname, Config $config) |
| 429 | 429 | { |
| 430 | - $defaultFile = trim($dirname, '/') . '/oss.txt'; |
|
| 430 | + $defaultFile = trim($dirname, '/').'/oss.txt'; |
|
| 431 | 431 | |
| 432 | 432 | return $this->write($defaultFile, '当虚拟目录下有其他文件时,可删除此文件~', $config); |
| 433 | 433 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | { |
| 480 | 480 | $path = $this->applyPathPrefix($path); |
| 481 | 481 | |
| 482 | - return $this->normalizeHost() . ltrim($path, '/'); |
|
| 482 | + return $this->normalizeHost().ltrim($path, '/'); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | /** |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | if ($this->isCName) { |
| 614 | 614 | $domain = $this->endpoint; |
| 615 | 615 | } else { |
| 616 | - $domain = $this->bucket . '.' . $this->endpoint; |
|
| 616 | + $domain = $this->bucket.'.'.$this->endpoint; |
|
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | if ($this->useSSL) { |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | $domain = "http://{$domain}"; |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - return rtrim($domain, '/') . '/'; |
|
| 625 | + return rtrim($domain, '/').'/'; |
|
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | /** |
@@ -59,9 +59,9 @@ |
||
| 59 | 59 | $path = $_SERVER['REQUEST_URI']; |
| 60 | 60 | $pos = strpos($path, '?'); |
| 61 | 61 | if ($pos === false) { |
| 62 | - $authStr = urldecode($path) . "\n" . $body; |
|
| 62 | + $authStr = urldecode($path)."\n".$body; |
|
| 63 | 63 | } else { |
| 64 | - $authStr = urldecode(substr($path, 0, $pos)) . substr($path, $pos, strlen($path) - $pos) . "\n" . $body; |
|
| 64 | + $authStr = urldecode(substr($path, 0, $pos)).substr($path, $pos, strlen($path) - $pos)."\n".$body; |
|
| 65 | 65 | } |
| 66 | 66 | // 验证签名 |
| 67 | 67 | $ok = openssl_verify($authStr, $authorization, $pubKey, OPENSSL_ALGO_MD5); |