From d39c1c072a85ec0fc2da9d5693148f137bf004f0 Mon Sep 17 00:00:00 2001
From: Katherine Bailey <katherine@katbailey.net>
Date: Wed, 18 Apr 2012 12:28:06 -0700
Subject: [PATCH] Update.php was missing a request object

---
 core/update.php |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/core/update.php b/core/update.php
index db9bd90..3f62ef1 100644
--- a/core/update.php
+++ b/core/update.php
@@ -14,6 +14,8 @@
  * back to its original state!
  */
 
+use Symfony\Component\HttpFoundation\Request;
+
 // Change the directory to the Drupal root.
 chdir('..');
 
@@ -433,6 +435,12 @@ drupal_maintenance_theme();
 // not passed through the error handler) will cause a message to be printed.
 ini_set('display_errors', TRUE);
 
+// A request object from the HTTPFoundation to tell us about the request.
+// @todo These two lines were copied from index.php which has its own todo about
+// a change required here. Revisit this when that change has been made.
+$request = Request::createFromGlobals();
+request($request);
+
 // Only proceed with updates if the user is allowed to run them.
 if (update_access_allowed()) {
 
@@ -446,22 +454,23 @@ if (update_access_allowed()) {
   // no errors, skip reporting them if the user has provided a URL parameter
   // acknowledging the warnings and indicating a desire to continue anyway. See
   // drupal_requirements_url().
-  $skip_warnings = !empty($_GET['continue']);
+  $continue = $request->query->get('continue');
+  $skip_warnings = !empty($continue);
   update_check_requirements($skip_warnings);
 
-  $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
+  $op = $request->query->get('op');
   switch ($op) {
     // update.php ops.
 
     case 'selection':
-      $token = request()->query->get('token');
+      $token = $request->query->get('token');
       if (isset($token) && drupal_valid_token($token, 'update')) {
         $output = update_selection_page();
         break;
       }
 
     case 'Apply pending updates':
-      $token = request()->query->get('token');
+      $token = $request->query->get('token');
       if (isset($token) && drupal_valid_token($token, 'update')) {
         // Generate absolute URLs for the batch processing (using $base_root),
         // since the batch API will pass them to url() which does not handle
-- 
1.7.5.4

