mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix: get rid of (some) PHP deprecation warnings (#66)
- CakeResponse.php strlen() no longer accepts null as a parameter Co-authored-by: Jan Pešek <jan@sinch.cz>
This commit is contained in:
parent
32459b11b6
commit
9140745ef1
2 changed files with 5 additions and 1 deletions
|
@ -55,6 +55,10 @@ It means that composer will look at `master` branch of repository configured und
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 2024-02-02
|
||||||
|
|
||||||
|
- `str_len` deprecation warning fix in CakeResponse (passing null instead of `string`)
|
||||||
|
|
||||||
### 2024-01-19
|
### 2024-01-19
|
||||||
|
|
||||||
- `strotime()` and `preg_split()` in CakeResponse deprecation warning fixes (passing null)
|
- `strotime()` and `preg_split()` in CakeResponse deprecation warning fixes (passing null)
|
||||||
|
|
|
@ -516,7 +516,7 @@ class CakeResponse {
|
||||||
if (ini_get('mbstring.func_overload') & 2 && function_exists('mb_strlen')) {
|
if (ini_get('mbstring.func_overload') & 2 && function_exists('mb_strlen')) {
|
||||||
$this->length($offset + mb_strlen($this->_body, '8bit'));
|
$this->length($offset + mb_strlen($this->_body, '8bit'));
|
||||||
} else {
|
} else {
|
||||||
$this->length($this->_headers['Content-Length'] = $offset + strlen($this->_body));
|
$this->length($this->_headers['Content-Length'] = $offset + ($this->_body === null ? 0 : strlen($this->_body)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue