mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Fixed error in sqlite regex implementation in certain edge cases
This commit is contained in:
parent
dd0f8ec97c
commit
fdf52a59fe
1 changed files with 5 additions and 1 deletions
|
@ -62,8 +62,12 @@ class SQLiteRegexExtensionMiddlewareDriver extends AbstractDriverMiddleware
|
|||
* @param string $value
|
||||
* @return int
|
||||
*/
|
||||
final public static function regexp(string $pattern, string $value): int
|
||||
final public static function regexp(string $pattern, ?string $value): int
|
||||
{
|
||||
if ($value === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
return (mb_ereg($pattern, $value)) ? 1 : 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue