diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index c9521ed..b535777 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -298,7 +298,7 @@ public function generateFromRoute($name, $parameters = array(), $options = array // Generate a relative URL having no path, just query string and fragment. if ($route->getOption('_no_path')) { - $query = $query_params ? '?' . UrlHelper::buildQuery($query_params) : ''; + $query = $query_params ? '?' . http_build_query($query_params, '', '&') : ''; $url = $query . $fragment; return $collect_bubbleable_metadata ? $generated_url->setGeneratedUrl($url) : $url; } diff --git a/core/modules/statistics/src/Tests/StatisticsReportsTest.php b/core/modules/statistics/src/Tests/StatisticsReportsTest.php index 2dbfa8d..f2a79ff 100644 --- a/core/modules/statistics/src/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/src/Tests/StatisticsReportsTest.php @@ -6,7 +6,6 @@ */ namespace Drupal\statistics\Tests; -use Drupal\Component\Utility\UrlHelper; /** * Tests display of statistics report blocks. @@ -27,7 +26,7 @@ function testPopularContentBlock() { $this->drupalGet('node/' . $node->id()); // Manually calling statistics.php, simulating ajax behavior. $nid = $node->id(); - $post = UrlHelper::buildQuery(array('nid' => $nid)); + $post = http_build_query(array('nid' => $nid)); $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; diff --git a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php index 9de2959..792c40a 100644 --- a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php @@ -7,8 +7,6 @@ namespace Drupal\statistics\Tests; -use Drupal\Component\Utility\UrlHelper; - /** * Generates text using placeholders for dummy content to check statistics token * replacement. @@ -31,7 +29,7 @@ function testStatisticsTokenReplacement() { $this->drupalGet('node/' . $node->id()); // Manually calling statistics.php, simulating ajax behavior. $nid = $node->id(); - $post = UrlHelper::buildQuery(array('nid' => $nid)); + $post = http_build_query(array('nid' => $nid)); $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php index 3c43406..f52d022 100644 --- a/core/modules/system/src/Tests/Common/UrlTest.php +++ b/core/modules/system/src/Tests/Common/UrlTest.php @@ -313,12 +313,12 @@ function testExternalUrls() { $url = $test_url; $query = array($this->randomMachineName(5) => $this->randomMachineName(5)); $result = Url::fromUri($url, array('query' => $query))->toString(); - $this->assertEqual($url . '?' . UrlHelper::buildQuery($query), $result, 'External URL can be extended with a query string in $options.'); + $this->assertEqual($url . '?' . http_build_query($query, '', '&'), $result, 'External URL can be extended with a query string in $options.'); // Verify query string can be extended in an external URL. $url = $test_url . '?drupal=awesome'; $query = array($this->randomMachineName(5) => $this->randomMachineName(5)); $result = Url::fromUri($url, array('query' => $query))->toString(); - $this->assertEqual($url . '&' . UrlHelper::buildQuery($query), $result); + $this->assertEqual($url . '&' . http_build_query($query, '', '&'), $result); } }