diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php index b0e255e..af82360 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php @@ -146,6 +146,7 @@ function testNoUpdateFunctionality() { $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE)); $this->assertText(t('No pending updates.')); $this->assertNoLink('Administration pages'); + $this->assertNoLinkByHref('update.php', 0); $this->clickLink('Front page'); $this->assertResponse(200); @@ -154,6 +155,8 @@ function testNoUpdateFunctionality() { $this->drupalLogin($admin_user); $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE)); $this->assertText(t('No pending updates.')); + $this->assertLink('Administration pages'); + $this->assertNoLinkByHref('update.php', 1); $this->clickLink('Administration pages'); $this->assertResponse(200); } @@ -170,6 +173,7 @@ function testSuccessfulUpdateFunctionality() { $this->assertText('Updates were attempted.'); $this->assertLink('site'); $this->assertNoLink('Administration pages'); + $this->assertNoLinkByHref('update.php', 0); $this->assertNoLink('logged'); $this->clickLink('Front page'); $this->assertResponse(200); @@ -183,6 +187,8 @@ function testSuccessfulUpdateFunctionality() { $this->drupalPost(NULL, array(), t('Apply pending updates')); $this->assertText('Updates were attempted.'); $this->assertLink('logged'); + $this->assertLink('Administration pages'); + $this->assertNoLinkByHref('update.php', 1); $this->clickLink('Administration pages'); $this->assertResponse(200); } diff --git a/core/update.php b/core/update.php index b73e3ce..9cd53ff 100644 --- a/core/update.php +++ b/core/update.php @@ -436,6 +436,12 @@ function update_check_requirements($skip_warnings = FALSE) { drupal_container() ->set('request', $request); +// Ensure that URLs generated for the home and admin pages don't have 'update.php' +// in them. +$generator = Drupal::urlGenerator(); +$generator->setBasePath(str_replace('/core', '', $request->getBasePath()) . '/'); +$generator->setScriptPath(''); + // There can be conflicting 'op' parameters because both update and batch use // this parameter name. We need the 'op' coming from a POST request to trump // that coming from a GET request.