Skip to content

Commit 170ecd4

Browse files
committed
Compare strings case-insensitive
1 parent a68b38a commit 170ecd4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

wcfsetup/install/files/lib/system/condition/type/user/AbstractUserStringConditionType.class.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ public function applyFilter(DatabaseObjectList $objectList): void
8181
public function matches(object $object): bool
8282
{
8383
["condition" => $condition, "value" => $value] = $this->filter;
84+
$value = \strtolower($value);
85+
$objectValue = \strtolower($object->{$this->columnName});
8486

8587
return match ($condition) {
86-
"_%" => \str_starts_with($object->{$this->columnName}, $value),
87-
"%_%" => \str_contains($object->{$this->columnName}, $value),
88-
"%_" => \str_ends_with($object->{$this->columnName}, $value),
88+
"_%" => \str_starts_with($objectValue, $value),
89+
"%_%" => \str_contains($objectValue, $value),
90+
"%_" => \str_ends_with($objectValue, $value),
8991
default => false,
9092
};
9193
}

0 commit comments

Comments
 (0)