mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +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
|
* @param string $value
|
||||||
* @return int
|
* @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 {
|
try {
|
||||||
return (mb_ereg($pattern, $value)) ? 1 : 0;
|
return (mb_ereg($pattern, $value)) ? 1 : 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue