Skip to content

Commit

Permalink
Update Accept.php (#40)
Browse files Browse the repository at this point in the history
Fixes: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
  • Loading branch information
mgralikowski authored Feb 11, 2024
1 parent 5c95c92 commit a5b901d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Parser/Accept.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function parse(Request $request, $strict = false)
{
$pattern = '/application\/'.$this->standardsTree.'\.('.$this->subtype.')\.([\w\d\.\-]+)\+([\w]+)/';

if (! preg_match($pattern, $request->header('accept'), $matches)) {
if (! preg_match($pattern, $request->header('accept', ''), $matches)) {
if ($strict) {
throw new BadRequestHttpException('Accept header could not be properly parsed because of a strict matching process.');
}
Expand Down

0 comments on commit a5b901d

Please sign in to comment.