Skip to content

Commit

Permalink
fix: get rid of (some) PHP deprecation warnings
Browse files Browse the repository at this point in the history
- RequestHandlerComponent might not have CONTENT_TYPE env set
- basics.php might not have SCRIPT_URI env set
  • Loading branch information
Jan Pešek committed Oct 19, 2023
1 parent 78e22f1 commit 250f535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/RequestHandlerComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public function requestedWith($type = null) {
return false;
}

list($contentType) = explode(';', env('CONTENT_TYPE'));
list($contentType) = explode(';', env('CONTENT_TYPE') ?? '');
if ($contentType === '') {
list($contentType) = explode(';', CakeRequest::header('CONTENT_TYPE'));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function env($key) {
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') {
Expand Down

0 comments on commit 250f535

Please sign in to comment.