Closed jberiksen closed 5 months ago
Do you know what value is passed in that triggers the error?
Maybe we need to add some preg_quote
but that's just a quess.
If the value in urlref not contians a query, there is no error.
There is another issue
I got also this error preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /core/UrlHelper.php:41
Edit: This is only an error that shows with my suggested change, so my first idea didn't fix the issue.
The problem is in our code. We are using preg_match($pattern, null)
to check if a regex is valid. This might throw a notice on newer php versions. I'll prepare a PR to fix that.
I got this errors in my log preg_match(): Delimiter must not be alphanumeric or backslash in /core/UrlHelper.php:41 preg_match(): Delimiter must not be alphanumeric or backslash in /core/UrlHelper.php:46
Matomo version: 5.0.3 PHP version: 8.1.28
As I see the solution could be this lines insted Line 41: if(@preg_match("/$val/", null) === false) { Line 46: if( preg_match("/$val/", $test) === 1 ) {