Loading core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ protected function buildExternalUrl($uri, array $options = [], $collect_bubbleab $parsed += ['query' => []]; $options += ['query' => []]; $options['query'] = NestedArray::mergeDeep($parsed['query'], $options['query']); $options['query'] = NestedArray::mergeDeepArray([$parsed['query'], $options['query']], TRUE); if ($parsed['fragment'] && !$options['fragment']) { $options['fragment'] = '#' . $parsed['fragment']; Loading core/modules/system/tests/src/Functional/Common/UrlTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,11 @@ public function testExternalUrls() { $result = Url::fromUri($url)->toString(); $this->assertEqual($url, $result); // Verify external URL can contain a query string with an integer key. $url = $test_url . '?120=1'; $result = Url::fromUri($url)->toString(); $this->assertEqual($url, $result); // Verify external URL can be extended with a query string. $url = $test_url; $query = ['awesome' => 'drupal']; Loading core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public function providerTestAssembleWithExternalUrl() { 'override-query' => ['https://example.com/test?foo=1#bar', ['query' => ['foo' => 2]], 'https://example.com/test?foo=2#bar'], 'override-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => 2]], 'https://example.com/test?foo=1&bar=2#bar'], 'override-deep-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?foo=1&bar%5Bbaz%5D=foo#bar'], 'override-deep-query-merge-int-ket' => ['https://example.com/test?120=1', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?120=1&bar%5Bbaz%5D=foo'], 'override-fragment' => ['https://example.com/test?foo=1#bar', ['fragment' => 'baz'], 'https://example.com/test?foo=1#baz'], ['//www.drupal.org', [], '//www.drupal.org'], ]; Loading Loading
core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ protected function buildExternalUrl($uri, array $options = [], $collect_bubbleab $parsed += ['query' => []]; $options += ['query' => []]; $options['query'] = NestedArray::mergeDeep($parsed['query'], $options['query']); $options['query'] = NestedArray::mergeDeepArray([$parsed['query'], $options['query']], TRUE); if ($parsed['fragment'] && !$options['fragment']) { $options['fragment'] = '#' . $parsed['fragment']; Loading
core/modules/system/tests/src/Functional/Common/UrlTest.php +5 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,11 @@ public function testExternalUrls() { $result = Url::fromUri($url)->toString(); $this->assertEqual($url, $result); // Verify external URL can contain a query string with an integer key. $url = $test_url . '?120=1'; $result = Url::fromUri($url)->toString(); $this->assertEqual($url, $result); // Verify external URL can be extended with a query string. $url = $test_url; $query = ['awesome' => 'drupal']; Loading
core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public function providerTestAssembleWithExternalUrl() { 'override-query' => ['https://example.com/test?foo=1#bar', ['query' => ['foo' => 2]], 'https://example.com/test?foo=2#bar'], 'override-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => 2]], 'https://example.com/test?foo=1&bar=2#bar'], 'override-deep-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?foo=1&bar%5Bbaz%5D=foo#bar'], 'override-deep-query-merge-int-ket' => ['https://example.com/test?120=1', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?120=1&bar%5Bbaz%5D=foo'], 'override-fragment' => ['https://example.com/test?foo=1#bar', ['fragment' => 'baz'], 'https://example.com/test?foo=1#baz'], ['//www.drupal.org', [], '//www.drupal.org'], ]; Loading