Index: index.php =================================================================== RCS file: /cvs/drupal/drupal/index.php,v retrieving revision 1.82 diff -u -F^f -r1.82 index.php --- index.php 21 Aug 2004 06:42:34 -0000 1.82 +++ index.php 5 Mar 2005 20:26:49 -0000 @@ -10,9 +10,67 @@ */ include_once 'includes/bootstrap.inc'; +unset($conf); +$config = conf_init(); + +include_once "$config/settings.php"; +include_once 'includes/database.inc'; +include_once 'includes/session.inc'; +include_once 'includes/module.inc'; + +// Initialize configuration variables, using values from conf.php if available. +$conf = variable_init(isset($conf) ? $conf : array()); + +// Start session +session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); +session_start(); + drupal_page_header(); include_once 'includes/common.inc'; +// Set the Drupal custom error handler. +set_error_handler('error_handler'); + +include_once 'includes/theme.inc'; +include_once 'includes/pager.inc'; +include_once 'includes/menu.inc'; +include_once 'includes/tablesort.inc'; +include_once 'includes/file.inc'; +include_once 'includes/xmlrpc.inc'; +include_once 'includes/image.inc'; + +// Emit the correct charset HTTP header. +drupal_set_header('Content-Type: text/html; charset=utf-8'); + +// Initialize $_GET['q'] prior to loading modules and invoking hook_init(). +if (!empty($_GET['q'])) { + $_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/')); +} +else { + $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); +} + +// Initialize all enabled modules. +module_init(); + +if (!user_access('bypass input data check')) { + // We can't use $_REQUEST because it consists of the contents of $_POST, + // $_GET and $_COOKIE: if any of the input arrays share a key, only one + // value will be verified. + if (!valid_input_data($_GET) + || !valid_input_data($_POST) + || !valid_input_data($_COOKIE) + || !valid_input_data($_FILES)) { + die('Terminated request because of suspicious input data.'); + } +} + +// Initialize the localization system. +$locale = locale_initialize(); + +// Initialize the enabled theme. +$theme = init_theme(); + fix_gpc_magic(); $status = menu_execute_active_handler(); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.38 diff -u -F^f -r1.38 bootstrap.inc --- includes/bootstrap.inc 9 Jan 2005 09:22:38 -0000 1.38 +++ includes/bootstrap.inc 5 Mar 2005 20:26:54 -0000 @@ -628,15 +628,4 @@ function drupal_get_messages() { return $messages; } -unset($conf); -$config = conf_init(); - -include_once "$config/settings.php"; -include_once 'includes/database.inc'; -include_once 'includes/session.inc'; -include_once 'includes/module.inc'; - -// Initialize configuration variables, using values from conf.php if available. -$conf = variable_init(isset($conf) ? $conf : array()); - ?> Index: includes/session.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/session.inc,v retrieving revision 1.14 diff -u -F^f -r1.14 session.inc --- includes/session.inc 1 Mar 2005 20:15:10 -0000 1.14 +++ includes/session.inc 5 Mar 2005 20:26:55 -0000 @@ -6,9 +6,6 @@ * User session handling functions. */ -session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); -session_start(); - /*** Session functions *****************************************************/ function sess_open($save_path, $session_name) { Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.428 diff -u -F^f -r1.428 common.inc --- includes/common.inc 3 Mar 2005 20:13:20 -0000 1.428 +++ includes/common.inc 5 Mar 2005 20:27:11 -0000 @@ -1863,48 +1863,4 @@ function drupal_get_path($type, $name) { } '); } - -// Set the Drupal custom error handler. -set_error_handler('error_handler'); - -include_once 'includes/theme.inc'; -include_once 'includes/pager.inc'; -include_once 'includes/menu.inc'; -include_once 'includes/tablesort.inc'; -include_once 'includes/file.inc'; -include_once 'includes/xmlrpc.inc'; -include_once 'includes/image.inc'; - -// Emit the correct charset HTTP header. -drupal_set_header('Content-Type: text/html; charset=utf-8'); - -// Initialize $_GET['q'] prior to loading modules and invoking hook_init(). -if (!empty($_GET['q'])) { - $_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/')); -} -else { - $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); -} - -// Initialize all enabled modules. -module_init(); - -if (!user_access('bypass input data check')) { - // We can't use $_REQUEST because it consists of the contents of $_POST, - // $_GET and $_COOKIE: if any of the input arrays share a key, only one - // value will be verified. - if (!valid_input_data($_GET) - || !valid_input_data($_POST) - || !valid_input_data($_COOKIE) - || !valid_input_data($_FILES)) { - die('Terminated request because of suspicious input data.'); - } -} - -// Initialize the localization system. -$locale = locale_initialize(); - -// Initialize the enabled theme. -$theme = init_theme(); - ?>