Compare commits

...

1 Commits

Author SHA1 Message Date
Josh 8acbe3e731 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 <josh.t.richards@gmail.com>
2025-11-03 18:13:07 -05:00
+2 -2
View File
@@ -38,9 +38,9 @@ class PgSqlTools {
/** @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) {