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
- RequestHandlerComponent might not have CONTENT_TYPE env set - basics.php might not have SCRIPT_URI env set
This commit is contained in:
parent
41af03e193
commit
0f1bb51402
2 changed files with 2 additions and 2 deletions
|
@ -531,7 +531,7 @@ class RequestHandlerComponent extends Component {
|
|||
return false;
|
||||
}
|
||||
|
||||
list($contentType) = explode(';', env('CONTENT_TYPE'));
|
||||
list($contentType) = explode(';', env('CONTENT_TYPE') ?? '');
|
||||
if ($contentType === '') {
|
||||
list($contentType) = explode(';', CakeRequest::header('CONTENT_TYPE'));
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ if (!function_exists('env')) {
|
|||
if (isset($_SERVER['HTTPS'])) {
|
||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
|
||||
}
|
||||
return (strpos(env('SCRIPT_URI'), 'https://') === 0);
|
||||
return (strpos(env('SCRIPT_URI') ?? '', 'https://') === 0);
|
||||
}
|
||||
|
||||
if ($key === 'SCRIPT_NAME') {
|
||||
|
|
Loading…
Reference in a new issue