diff --git a/core/modules/link/src/Plugin/migrate/process/FieldLink.php b/core/modules/link/src/Plugin/migrate/process/FieldLink.php index 353a89c..978f4e9 100644 --- a/core/modules/link/src/Plugin/migrate/process/FieldLink.php +++ b/core/modules/link/src/Plugin/migrate/process/FieldLink.php @@ -70,78 +70,11 @@ protected function canonicalizeUri($uri) { } else { // List of unicode-encoded characters that were allowed in URLs, - // according to link module in Drupal 7. + // according to link module in Drupal 7. Every character between ¿ + // and ÿ (except × × and ÷ ÷) with the addition of + // Œ, œ and Ÿ. // @see http://cgit.drupalcode.org/link/tree/link.module?h=7.x-1.5-beta2#n1382 - $link_ichars = implode('', [ - "¿", // ¿ - "À", // À - "Á", // Á - "Â", //  - "Ã", // à - "Ä", // Ä - "Å", // Å - "Æ", // Æ - "Ç", // Ç - "È", // È - "É", // É - "Ê", // Ê - "Ë", // Ë - "Ì", // Ì - "Í", // Í - "Î", // Î - "Ï", // Ï - "Ð", // Ð - "Ñ", // Ñ - "Ò", // Ò - "Ó", // Ó - "Ô", // Ô - "Õ", // Õ - "Ö", // Ö - // × × - "Ø", // Ø - "Ù", // Ù - "Ú", // Ú - "Û", // Û - "Ü", // Ü - "Ý", // Ý - "Þ", // Þ - "ß", // ß - "à", // à - "á", // á - "â", // â - "ã", // ã - "ä", // ä - "å", // å - "æ", // æ - "ç", // ç - "è", // è - "é", // é - "ê", // ê - "ë", // ë - "ì", // ì - "í", // í - "î", // î - "ï", // ï - "ð", // ð - "ñ", // ñ - "ò", // ò - "ó", // ó - "ô", // ô - "õ", // õ - "ö", // ö - // ÷ ÷ - "ø", // ø - "ù", // ù - "ú", // ú - "û", // û - "ü", // ü - "ý", // ý - "þ", // þ - "ÿ", // ÿ - "Œ", // Œ - "œ", // œ - "Ÿ", // Ÿ - ]); + $link_ichars = '¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿŒœŸ'; // Pattern specific to internal links. $internal_pattern = "/^(?:[a-z0-9" . $link_ichars . "_\-+\[\] ]+)"; diff --git a/core/modules/link/src/Plugin/migrate/process/d6/FieldLink.php b/core/modules/link/src/Plugin/migrate/process/d6/FieldLink.php index 4c4af30..19c5e35 100644 --- a/core/modules/link/src/Plugin/migrate/process/d6/FieldLink.php +++ b/core/modules/link/src/Plugin/migrate/process/d6/FieldLink.php @@ -14,5 +14,4 @@ * @deprecated in Drupal 8.4.x, to be removed before Drupal 9.0.x. Use * \Drupal\link\Plugin\migrate\process\FieldLink instead. */ -class FieldLink extends GeneralPurposeFieldLink { } - +class FieldLink extends GeneralPurposeFieldLink {} diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php index 48d603a..f765f6a 100644 --- a/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php +++ b/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php @@ -70,6 +70,14 @@ public function canonicalizeUriDataProvider() { 'http://www.ßÀÑÐ¥ƒå¢ë.com', 'http://www.ßÀÑÐ¥ƒå¢ë.com', ], + 'Absolute URL with non-standard characters, without protocol prefix' => [ + 'www.ÐØÑ¢åþë.com', + 'http://www.ÐØÑ¢åþë.com', + ], + 'Absolute URL with non-standard top level domain' => [ + 'http://www.example.xxx', + 'http://www.example.xxx', + ], 'Internal link with fragment' => [ '/node/10#top', 'internal:/node/10#top',