diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index 46eeef8..b8fcdeb 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -341,9 +341,7 @@ public function setAbsolute($absolute = TRUE) { */ public function toString() { if ($this->isExternal()) { - $options = $this->getOptions(); - $options['external'] = TRUE; - return $this->urlGenerator()->generateFromPath($this->getPath(), $options); + return $this->urlGenerator()->generateFromPath($this->getPath(), $this->getOptions()); } return $this->urlGenerator()->generateFromRoute($this->getRouteName(), $this->getRouteParameters(), $this->getOptions()); diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php index 7def9b8..1d01b16 100644 --- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php @@ -159,7 +159,7 @@ public function testGenerateFromUrl() { public function testGenerateFromUrlExternal() { $this->urlGenerator->expects($this->once()) ->method('generateFromPath') - ->with('http://drupal.org', array('external' => TRUE, 'set_active_class' => TRUE) + $this->defaultOptions) + ->with('http://drupal.org', array('set_active_class' => TRUE) + $this->defaultOptions) ->will($this->returnValue('http://drupal.org')); $this->moduleHandler->expects($this->once())