diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php
index c353e69..edf59a8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/GotoTest.php
@@ -47,12 +47,26 @@ function testDrupalGoto() {
     $this->assertText('drupal_goto', 'Drupal goto redirect succeeded.');
     $this->assertEqual($this->getUrl(), url('common-test/drupal_goto', array('query' => array('foo' => '123'), 'absolute' => TRUE)), 'Drupal goto redirected to expected URL.');
 
-    // Test that drupal_goto() respects ?destination=xxx. Use an complicated URL
+    // Test that drupal_goto() respects ?destination=xxx. Use a complicated URL
     // to test that the path is encoded and decoded properly.
     $destination = 'common-test/drupal_goto/destination?foo=%2525&bar=123';
     $this->drupalGet('common-test/drupal_goto/redirect', array('query' => array('destination' => $destination)));
     $this->assertText('drupal_goto', 'Drupal goto redirect with destination succeeded.');
     $this->assertEqual($this->getUrl(), url('common-test/drupal_goto/destination', array('query' => array('foo' => '%25', 'bar' => '123'), 'absolute' => TRUE)), 'Drupal goto redirected to given query string destination.');
+
+    // Test that drupal_goto() respects ?destination=xxx with an absolute URL
+    // that points to this Drupal installation.
+    $destination = url('common-test/drupal_goto/alt', array('absolute' => TRUE));
+    $this->drupalGet('common-test/drupal_goto/redirect', array('query' => array('destination' => $destination)));
+    $this->assertText('drupal_goto_alt', 'Drupal goto redirect with absolute URL destination that points to this Drupal installation succeeded.');
+    $this->assertEqual($this->getUrl(), url('common-test/drupal_goto/alt', array('absolute' => TRUE)), 'Drupal goto redirected to given query string destination with absolute URL that points to this Drupal installation.');
+
+    // Test that drupal_goto() fails to respect ?destination=xxx with an absolute URL
+    // that does not point to this Drupal installation.
+    $destination = 'http://pagedoesnotexist';
+    $this->drupalGet('common-test/drupal_goto/redirect', array('query' => array('destination' => $destination)));
+    $this->assertText('drupal_goto', 'Drupal goto fails to redirect with absolute URL destination that does not point to this Drupal installation.');
+    $this->assertNotEqual($this->getUrl(), $destination, 'Drupal goto failed to redirect to given query string destination with absolute URL that does not point to this Drupal installation.');
   }
 
   /**
diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module
index 0634e3b..e5430ff 100644
--- a/core/modules/system/tests/modules/common_test/common_test.module
+++ b/core/modules/system/tests/modules/common_test/common_test.module
@@ -15,6 +15,12 @@ function common_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
+  $items['common-test/drupal_goto/alt'] = array(
+    'title' => 'Drupal Goto',
+    'page callback' => 'common_test_drupal_goto_land_alt',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
   $items['common-test/drupal_goto/fail'] = array(
     'title' => 'Drupal Goto',
     'page callback' => 'common_test_drupal_goto_land_fail',
@@ -85,6 +91,15 @@ function common_test_drupal_goto_land() {
 }
 
 /**
+ * Page callback: Provides a landing page for drupal_goto().
+ *
+ * @see common_test_menu()
+ */
+function common_test_drupal_goto_land_alt() {
+  print "drupal_goto_alt";
+}
+
+/**
  * Page callback: Provides a failure landing page for drupal_goto().
  *
  * @see common_test_menu()
