diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20250624012300.php b/src/CoreBundle/Migrations/Schema/V200/Version20250624012300.php new file mode 100644 index 00000000000..aab3e9e9f9b --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20250624012300.php @@ -0,0 +1,46 @@ +connection->fetchAllAssociative( + "SELECT id, original_name FROM language WHERE original_name LIKE '%&%;%'" + ); + + foreach ($languages as $lang) { + $decoded = html_entity_decode((string) $lang['original_name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + + // Only update if the decoded value is different + if ($decoded !== $lang['original_name']) { + $this->addSql( + "UPDATE language SET original_name = :decoded WHERE id = :id", + [ + 'decoded' => $decoded, + 'id' => $lang['id'], + ] + ); + } + } + } + + public function down(Schema $schema): void + { + // This migration is not reversible, as the original entity-encoded values are lost + } +}