Skip to content

Commit

Permalink
Fix deprecation PHP : strpos null argument
Browse files Browse the repository at this point in the history
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/html/src/Services/Oai/Arguments/ArgumentTrait.php:22)"} []
  • Loading branch information
plecor committed Oct 18, 2023
1 parent 6feda82 commit ba30fdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion symfony/src/Services/Oai/Arguments/ArgumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getValue(): ?string

public function setValue(?string $value)
{
if (strpos($value, 'amp;')) {
if ($value !== null && strpos($value, 'amp;')) {
$value = substr($value, 0, 4);
}
$this->value = $value;
Expand Down

0 comments on commit ba30fdc

Please sign in to comment.