Skip to content

Commit 52f1513

Browse files
authored
fix: check type of query result before parsing to int (#51)
1 parent abb55b5 commit 52f1513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Migration/Migration1738788990ImportExportTechnicalName.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public function getCreationTimestamp(): int
1717

1818
public function update(Connection $connection): void
1919
{
20-
$count = (int)$connection->executeQuery(
20+
$count = $connection->executeQuery(
2121
'SELECT COUNT(*) as count FROM import_export_profile WHERE source_entity = :sourceEntity AND system_default = 1',
2222
['sourceEntity' => RedirectDefinition::ENTITY_NAME]
2323
)->fetchOne();
2424

25-
if ($count > 1) {
25+
if (\is_scalar($count) && (int)$count > 1) {
2626
$connection->executeStatement(
2727
'DELETE FROM import_export_profile WHERE source_entity = :sourceEntity AND system_default = 1',
2828
['sourceEntity' => RedirectDefinition::ENTITY_NAME]

0 commit comments

Comments
 (0)