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:
Jan Pešek 2023-10-19 10:09:26 +02:00 committed by Kamil Wylegala
parent 41af03e193
commit 0f1bb51402
2 changed files with 2 additions and 2 deletions

View file

@ -531,7 +531,7 @@ class RequestHandlerComponent extends Component {
return false; return false;
} }
list($contentType) = explode(';', env('CONTENT_TYPE')); list($contentType) = explode(';', env('CONTENT_TYPE') ?? '');
if ($contentType === '') { if ($contentType === '') {
list($contentType) = explode(';', CakeRequest::header('CONTENT_TYPE')); list($contentType) = explode(';', CakeRequest::header('CONTENT_TYPE'));
} }

View file

@ -323,7 +323,7 @@ if (!function_exists('env')) {
if (isset($_SERVER['HTTPS'])) { if (isset($_SERVER['HTTPS'])) {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'); 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') { if ($key === 'SCRIPT_NAME') {