Skip to content

ignore php8.x type check #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Qiniu/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,15 @@ public function signQiniuAuthorization($urlString, $method = "GET", $body = "",

// append body
$data .= "\n\n";
if (strlen($body) > 0
if (!is_null($body)
&& strlen($body) > 0
&& isset($headers["Content-Type"])
&& $headers["Content-Type"] != "application/octet-stream"
) {
$data .= $body;
}

return array($this->sign(utf8_encode($data)), null);
return array($this->sign($data), null);
}

public function verifyCallback($contentType, $originAuthorization, $url, $body)
Expand Down
4 changes: 4 additions & 0 deletions src/Qiniu/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ final class Config
public $useHTTPS;
//BOOL 是否使用CDN加速上传域名
public $useCdnDomains;
/**
* @var Region
*/
public $zone;
// Zone Cache
private $regionCache;

Expand Down
3 changes: 3 additions & 0 deletions src/Qiniu/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public static function sendRequest($request)

private static function escapeQuotes($str)
{
if (is_null($str)) {
return null;
}
$find = array("\\", "\"");
$replace = array("\\\\", "\\\"");
return str_replace($find, $replace, $str);
Expand Down
6 changes: 6 additions & 0 deletions src/Qiniu/Http/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function getRawData()
*
* @return boolean
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function offsetExists($offset)
{
$key = self::normalizeKey($offset);
Expand All @@ -122,6 +123,7 @@ public function offsetExists($offset)
*
* @return string|null
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function offsetGet($offset)
{
$key = self::normalizeKey($offset);
Expand All @@ -138,6 +140,7 @@ public function offsetGet($offset)
*
* @return void
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function offsetSet($offset, $value)
{
$key = self::normalizeKey($offset);
Expand All @@ -151,6 +154,7 @@ public function offsetSet($offset, $value)
/**
* @return void
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function offsetUnset($offset)
{
$key = self::normalizeKey($offset);
Expand All @@ -160,6 +164,7 @@ public function offsetUnset($offset)
/**
* @return \ArrayIterator
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function getIterator()
{
$arr = array();
Expand All @@ -172,6 +177,7 @@ public function getIterator()
/**
* @return int
*/
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
public function count()
{
return count($this->data);
Expand Down