summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-06 15:20:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-06 15:20:09 +0000
commitaf884c3888c9db680fa11b8fd7804265f4c71960 (patch)
tree150e2de9176ace09bae54f563b20d8a54cb33980
parent73356fde8b3ebd076e2c588bb8935f914fd8ebb8 (diff)
downloadbrdo-af884c3888c9db680fa11b8fd7804265f4c71960.tar.gz
brdo-af884c3888c9db680fa11b8fd7804265f4c71960.tar.bz2
#302763 by DamZ: Fixing test failures, removing legacy globals check cruft.
-rw-r--r--includes/bootstrap.inc17
-rw-r--r--modules/simpletest/tests/session.test2
2 files changed, 7 insertions, 12 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 78a41f732..8b15ab737 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -302,16 +302,11 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
}
/**
- * Unsets all disallowed global variables. See $allowed for what's allowed.
- */
-function drupal_unset_globals() {
- if (ini_get('register_globals')) {
- $allowed = array('_ENV' => 1, '_GET' => 1, '_POST' => 1, '_COOKIE' => 1, '_FILES' => 1, '_SERVER' => 1, '_REQUEST' => 1, 'GLOBALS' => 1);
- foreach ($GLOBALS as $key => $value) {
- if (!isset($allowed[$key])) {
- unset($GLOBALS[$key]);
- }
- }
+ * Initialize variables needed for the rest of the execution.
+ */
+function drupal_initialize_variables() {
+ if (!isset($_SERVER['HTTP_REFERER'])) {
+ $_SERVER['HTTP_REFERER'] = '';
}
}
@@ -993,7 +988,7 @@ function _drupal_bootstrap($phase) {
switch ($phase) {
case DRUPAL_BOOTSTRAP_CONFIGURATION:
- drupal_unset_globals();
+ drupal_initialize_variables();
// Start a page timer:
timer_start('page');
// Initialize the configuration
diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test
index b4835832d..2e564e0bf 100644
--- a/modules/simpletest/tests/session.test
+++ b/modules/simpletest/tests/session.test
@@ -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'));
// 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'));
}