diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index 1915b981a..513af4029 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -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')); } diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 10d965c1c..0e9f13956 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -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') {