Nantes: Broken clouds, 2 °C
Paris-Orly: Broken clouds, mist, light freezing drizzle, 0 °C
Berlin-Schönefeld: Broken clouds, -5 °C
Current weatherNantes: Broken clouds, 2 °C Paris-Orly: Broken clouds, mist, light freezing drizzle, 0 °C Berlin-Schönefeld: Broken clouds, -5 °C |
Howto fix Drupal's update.php when $_REQUEST is denied by a paranoid sysadmin
Submitted by pounard on Sun, 05/17/2009 - 13:07
I dont know how much people get to this problem, but one thing is sure: when you have a paranoid sysadmin, you might encounter some surprises with PHP and globals. The annoying case is here when you restrict PHP to the maximum you can, you can't access to the $_REQUEST superglobal. FYI1, this superglobal is an array merge (copius vulgaris2) of both $_POST and $_GET superglobals.. What's saves us is that in Drupal's core code, this $_REQUEST superglobal is never used (or was sometimes ago), some grep3 revealed it to me. But, what's annoying here, is the only part of Drupal I found usage of this variable, is the update.php file. So, what happens in real life, when you try to update you site in this case? Why? Because update.php can't find it's op parameter, which, in facts, comes directly from $_GET or $_POST (depending on the step you are). So, the actual solution, is this patch (working for Drupal 6.12): % diff -urN update.php.orig update.phpWTF does this patch4 do?! One line of code, some hours of happyness saved!
|
$_REQUEST also merges in $_COOKIE
"this superglobal is an array merge (copius vulgaris2) of both $_POST and $_GET superglobals.."
And it also merges in $_COOKIE
in pre 4.3 it also included $_FILES
Also works with Drupal 6.13
This patch also works with Drupal 6.13