From 8acbe3e73124e1a9b9b4cefdbdb752a250e0c3d1 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Nov 2025 18:13:07 -0500 Subject: [PATCH] fix(db): make sure PgSqlTools filter only accepts actual matches The schema assets filter previously used preg_match(... ) !== false, which treats 0 (no match) as true and caused non-matching assets to be accepted. Use preg_match(... ) === 1 so the filter only accepts actual matches and avoids false positives. Signed-off-by: Josh --- lib/private/DB/PgSqlTools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/DB/PgSqlTools.php b/lib/private/DB/PgSqlTools.php index d529cb26b09d5..5ddebed7112d4 100644 --- a/lib/private/DB/PgSqlTools.php +++ b/lib/private/DB/PgSqlTools.php @@ -38,9 +38,9 @@ public function resynchronizeDatabaseSequences(Connection $conn) { /** @var string|AbstractAsset $asset */ $filterExpression = '/^' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_')) . '/'; if ($asset instanceof AbstractAsset) { - return preg_match($filterExpression, $asset->getName()) !== false; + return preg_match($filterExpression, $asset->getName()) === 1; } - return preg_match($filterExpression, $asset) !== false; + return preg_match($filterExpression, $asset) === 1; }); foreach ($conn->createSchemaManager()->listSequences() as $sequence) {