Issue #3138348 by poker10, awset, mikeytown2: system_batch_page() should call drupal_exit() after drupal_access_denied()

merge-requests/3045/head
Juraj Nemec 2022-09-03 14:41:56 +02:00
parent 6fbeaa6b35
commit 40d1dbb9f4
No known key found for this signature in database
GPG Key ID: 01EC3E1EECB5B2CA
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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.');
}
}