From 58d81162bf7fdf9302a8165ceacbe989163e1bed Mon Sep 17 00:00:00 2001 From: dena Date: Fri, 23 Jan 2026 15:23:43 +0100 Subject: [PATCH] add comments --- app/Services/WikiUserEmailChecker.php | 3 +++ tests/Commands/User/CheckUserEmailExistTest.php | 1 + 2 files changed, 4 insertions(+) diff --git a/app/Services/WikiUserEmailChecker.php b/app/Services/WikiUserEmailChecker.php index 6efa4e69..6a653578 100644 --- a/app/Services/WikiUserEmailChecker.php +++ b/app/Services/WikiUserEmailChecker.php @@ -46,7 +46,10 @@ private function emailExists(PDO $pdo, string $dbName, string $table, string $em $stmt = $pdo->prepare(" SELECT 1 FROM {$dbName}.{$table} + + -- converting from tinyblob data type, see https://github.com/wbstack/api/blob/main/database/mw/new/mw1.43-wbs2.sql#L1006 WHERE LOWER(CONVERT(user_email USING utf8mb4)) = LOWER(:email) + LIMIT 1 "); diff --git a/tests/Commands/User/CheckUserEmailExistTest.php b/tests/Commands/User/CheckUserEmailExistTest.php index 98dfd20d..8d94da04 100644 --- a/tests/Commands/User/CheckUserEmailExistTest.php +++ b/tests/Commands/User/CheckUserEmailExistTest.php @@ -9,6 +9,7 @@ class CheckUserEmailExistTest extends TestCase { protected function tearDown(): void { + // delete all users User::query()->delete(); }