Merge pull request #25922 from nextcloud/backport/25882/stable21

[stable21] Filter out tables that does not belong to Nextcloud
This commit is contained in:
Roeland Jago Douma 2021-03-04 08:28:41 +01:00 committed by GitHub
commit 27e2f066a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -181,9 +181,9 @@ class Migrator {
/** @var string|AbstractAsset $asset */ /** @var string|AbstractAsset $asset */
$filterExpression = $this->getFilterExpression(); $filterExpression = $this->getFilterExpression();
if ($asset instanceof AbstractAsset) { 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;
}); });
return $this->connection->getSchemaManager()->createSchema(); return $this->connection->getSchemaManager()->createSchema();
} }
@ -210,9 +210,9 @@ class Migrator {
/** @var string|AbstractAsset $asset */ /** @var string|AbstractAsset $asset */
$filterExpression = $this->getFilterExpression(); $filterExpression = $this->getFilterExpression();
if ($asset instanceof AbstractAsset) { 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;
}); });
$sourceSchema = $connection->getSchemaManager()->createSchema(); $sourceSchema = $connection->getSchemaManager()->createSchema();