From b074b7db28e0164d85ac93a597e21a8e4cc4721a Mon Sep 17 00:00:00 2001 From: Jukka Lampikoski Date: Tue, 10 Mar 2026 16:26:44 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20add=20unicode=20flag=20to=20named=20para?= =?UTF-8?q?m=20regex=20for=20=C3=B6/=C3=A4=20chars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Column name yhteyshenkilö contains ö which \w doesn't match without the /u flag. This caused SQL syntax errors. Co-Authored-By: Claude Opus 4.6 --- db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.php b/db.php index 1f7e265..f5adfa5 100644 --- a/db.php +++ b/db.php @@ -35,7 +35,7 @@ function _dbRun(string $sql, array $params = []): mysqli_stmt { // Muunna nimetyt parametrit (:name) positiivisiksi (?) if (!empty($params) && !array_is_list($params)) { $ordered = []; - $sql = preg_replace_callback('/:(\w+)/', function($m) use ($params, &$ordered) { + $sql = preg_replace_callback('/:(\w+)/u', function($m) use ($params, &$ordered) { $key = $m[1]; $ordered[] = array_key_exists($key, $params) ? $params[$key] : null; return '?';