Skip to content

Commit 17830ab

Browse files
committed
refactor code
1 parent 881bcc3 commit 17830ab

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Qiniu/Zone.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ private function unmarshalUpToken($uptoken)
7272
$policy = base64_urlSafeDecode($token[2]);
7373
$policy = json_decode($policy, true);
7474

75-
$bucket = $policy['scope'];
76-
if (strpos($bucket, ':')) {
77-
$bucket = split(':', $bucket)[0];
78-
}
79-
75+
$scope = $policy['scope'];
76+
$bucket = $scope;
77+
78+
if (strpos($scope, ':')) {
79+
$scopes = split(':', $scope);
80+
$bucket = $scopes[0];
81+
}
82+
8083
return array($ak, $bucket);
8184
}
8285

0 commit comments

Comments
 (0)