Skip to content

Commit

Permalink
Merge pull request #5 from froozeify/scanning-licence-card
Browse files Browse the repository at this point in the history
Fix licence regex
  • Loading branch information
froozeify authored Feb 24, 2024
2 parents 2c8da08 + 91eb0ee commit ea3f0c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Repository/MemberRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function loadUserByIdentifier(string $identifier): ?UserInterface {
* @return array
*/
public function findByLicenceOrName(string $string): array {
$string = trim($string);

$qb = $this->createQueryBuilder("m");
$qb
->andWhere(
Expand All @@ -73,7 +75,7 @@ public function findByLicenceOrName(string $string): array {
);

$matches = [];
preg_match("/^(\d+)-(\d|\/)+$/m", $string, $matches);
preg_match("/^(\d{8,})/m", $string, $matches);

if (!empty($matches)) {
$qb->setParameter('licence', $matches[1]);
Expand Down

0 comments on commit ea3f0c1

Please sign in to comment.