Verified Commit 40d1dbb9 authored by Juraj Nemec's avatar Juraj Nemec
Browse files

Issue #3138348 by poker10, awset, mikeytown2: system_batch_page() should call...

Issue #3138348 by poker10, awset, mikeytown2: system_batch_page() should call drupal_exit() after drupal_access_denied()
parent 6fbeaa6b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2398,6 +2398,7 @@ function system_batch_page() {

  if ($output === FALSE) {
    drupal_access_denied();
    drupal_exit();
  }
  elseif (isset($output)) {
    // Force a page without blocks or messages to
+10 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,16 @@ class AccessDeniedTestCase extends DrupalWebTestCase {

    // Check that we're still on the same page.
    $this->assertText(t('Site information'));

    // Check batch page response.
    $query_parameters = array(
      ':type' => 'php',
      ':severity' => WATCHDOG_WARNING,
    );
    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND severity = :severity', $query_parameters)->fetchField(), 0, 'No warning message appears in the logs before accessing the batch page.');
    $this->drupalGet('batch');
    $this->assertResponse(403);
    $this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND severity = :severity', $query_parameters)->fetchField(), 0, 'No warning message appears in the logs after accessing the batch page.');
  }
}