summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-03-04 17:54:37 (GMT)
committerwebchick2014-03-04 20:09:35 (GMT)
commit5e46282f6c46e8c1e9c2cda434f3c656c39f944f (patch)
tree3007a82f996638ced21e7c208091a6832c0e17d6
parente93b685205fa5aa261953b5f14db1a7d2c0ff0ed (diff)
Issue #2192653 by ianthomas_uk, divesh.kumar: Remove drupal_set_title from authorize.php.
-rw-r--r--core/authorize.php26
-rw-r--r--core/includes/authorize.inc4
-rw-r--r--core/modules/system/system.module2
-rw-r--r--core/modules/update/update.authorize.inc2
4 files changed, 12 insertions, 22 deletions
diff --git a/core/authorize.php b/core/authorize.php
index 6bc2808..d812f2e 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -37,16 +37,6 @@ require_once __DIR__ . '/vendor/autoload.php';
const MAINTENANCE_MODE = 'update';
/**
- * Renders a 403 access denied page for authorize.php.
- */
-function authorize_access_denied_page() {
- drupal_add_http_header('Status', '403 Forbidden');
- watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
- drupal_set_title('Access denied');
- return t('You are not allowed to access this page.');
-}
-
-/**
* Determines if the current user is allowed to run authorize.php.
*
* The killswitch in settings.php overrides all else, otherwise, the user must
@@ -97,11 +87,11 @@ if (authorize_access_allowed()) {
// Load the code that drives the authorize process.
require_once __DIR__ . '/includes/authorize.inc';
- if (isset($_SESSION['authorize_operation']['page_title'])) {
- drupal_set_title($_SESSION['authorize_operation']['page_title']);
+ if (isset($_SESSION['authorize_page_title'])) {
+ $page_title = $_SESSION['authorize_page_title'];
}
else {
- drupal_set_title(t('Authorize file system changes'));
+ $page_title = t('Authorize file system changes');
}
// See if we've run the operation and need to display a report.
@@ -113,7 +103,7 @@ if (authorize_access_allowed()) {
unset($_SESSION['authorize_filetransfer_info']);
if (!empty($results['page_title'])) {
- drupal_set_title($results['page_title']);
+ $page_title = $results['page_title'];
}
if (!empty($results['page_message'])) {
drupal_set_message($results['page_message']['message'], $results['page_message']['type']);
@@ -161,12 +151,18 @@ if (authorize_access_allowed()) {
$show_messages = !(($batch = batch_get()) && isset($batch['running']));
}
else {
- $output = authorize_access_denied_page();
+ drupal_add_http_header('Status', '403 Forbidden');
+ watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
+ $page_title = t('Access denied');
+ $output = t('You are not allowed to access this page.');
}
if (!empty($output)) {
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
$maintenance_page = array(
+ '#page' => array(
+ '#title' => $page_title,
+ ),
'#theme' => 'maintenance_page',
'#content' => $output,
'#show_messages' => $show_messages,
diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc
index 70fb4ca..238a3c6 100644
--- a/core/includes/authorize.inc
+++ b/core/includes/authorize.inc
@@ -290,10 +290,6 @@ function authorize_run_operation($filetransfer) {
$operation = $_SESSION['authorize_operation'];
unset($_SESSION['authorize_operation']);
- if (!empty($operation['page_title'])) {
- drupal_set_title($operation['page_title']);
- }
-
require_once DRUPAL_ROOT . '/' . $operation['file'];
call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments']));
}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 4befe46..67b25fe 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1014,7 +1014,7 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
);
if (isset($page_title)) {
- $_SESSION['authorize_operation']['page_title'] = $page_title;
+ $_SESSION['authorize_page_title'] = $page_title;
}
}
diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc
index c4f3ad8..3bfdbcf 100644
--- a/core/modules/update/update.authorize.inc
+++ b/core/modules/update/update.authorize.inc
@@ -237,7 +237,6 @@ function update_authorize_update_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks'];
- $_SESSION['authorize_operation']['page_title'] = t('Update manager');
}
/**
@@ -296,7 +295,6 @@ function update_authorize_install_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks'];
- $_SESSION['authorize_operation']['page_title'] = t('Update manager');
}
/**