Commit af884c38 authored by webchick's avatar webchick
Browse files

#302763 by DamZ: Fixing test failures, removing legacy globals check cruft.

parent 73356fde
...@@ -302,16 +302,11 @@ function conf_path($require_settings = TRUE, $reset = FALSE) { ...@@ -302,16 +302,11 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
} }
/** /**
* Unsets all disallowed global variables. See $allowed for what's allowed. * Initialize variables needed for the rest of the execution.
*/ */
function drupal_unset_globals() { function drupal_initialize_variables() {
if (ini_get('register_globals')) { if (!isset($_SERVER['HTTP_REFERER'])) {
$allowed = array('_ENV' => 1, '_GET' => 1, '_POST' => 1, '_COOKIE' => 1, '_FILES' => 1, '_SERVER' => 1, '_REQUEST' => 1, 'GLOBALS' => 1); $_SERVER['HTTP_REFERER'] = '';
foreach ($GLOBALS as $key => $value) {
if (!isset($allowed[$key])) {
unset($GLOBALS[$key]);
}
}
} }
} }
...@@ -993,7 +988,7 @@ function _drupal_bootstrap($phase) { ...@@ -993,7 +988,7 @@ function _drupal_bootstrap($phase) {
switch ($phase) { switch ($phase) {
case DRUPAL_BOOTSTRAP_CONFIGURATION: case DRUPAL_BOOTSTRAP_CONFIGURATION:
drupal_unset_globals(); drupal_initialize_variables();
// Start a page timer: // Start a page timer:
timer_start('page'); timer_start('page');
// Initialize the configuration // Initialize the configuration
......
...@@ -113,7 +113,7 @@ class SessionTestCase extends DrupalWebTestCase { ...@@ -113,7 +113,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->assertEqual($authenticated, $this->session_count_authenticated, t('Correctly counted @count authenticated sessions.', array('@count' => $authenticated)), t('Session')); $this->assertEqual($authenticated, $this->session_count_authenticated, t('Correctly counted @count authenticated sessions.', array('@count' => $authenticated)), t('Session'));
// Should return 0 sessions from 1 second from now. // Should return 0 sessions from 1 second from now.
$this->assertEqual(sess_count($_SERVER['REQUEST_TIME'] + 1), 0, t('Correctly returned 0 sessions newer than the current time.'), t('Session')); $this->assertEqual(sess_count(time() + 1), 0, t('Correctly returned 0 sessions newer than the current time.'), t('Session'));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment