Skip to content

Commit 13c677e

Browse files
authored
Merge pull request #378 from qiniu/fix/count-string
fix using count to get string length & header setter
2 parents 8414ee6 + 5b1bf18 commit 13c677e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Qiniu/Auth.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function signQiniuAuthorization($urlString, $method = "GET", $body = "",
114114

115115
// append body
116116
$data .= "\n\n";
117-
if (count($body) > 0
117+
if (strlen($body) > 0
118118
&& isset($headers["Content-Type"])
119119
&& $headers["Content-Type"] != "application/octet-stream"
120120
) {

src/Qiniu/Http/Header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function offsetGet($offset)
141141
public function offsetSet($offset, $value)
142142
{
143143
$key = self::normalizeKey($offset);
144-
if (isset($this->data[$key]) && count($this->data[$key] > 0)) {
144+
if (isset($this->data[$key]) && count($this->data[$key]) > 0) {
145145
$this->data[$key][0] = self::normalizeValue($value);
146146
} else {
147147
$this->data[$key] = array(self::normalizeValue($value));

0 commit comments

Comments
 (0)