? sites/default/files ? sites/default/settings.php Index: cron.php =================================================================== RCS file: /cvs/drupal/drupal/cron.php,v retrieving revision 1.38 diff -u -u -r1.38 cron.php --- cron.php 9 May 2008 19:23:48 -0000 1.38 +++ cron.php 17 May 2008 15:55:36 -0000 @@ -6,7 +6,9 @@ * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs). */ -include_once './includes/bootstrap.inc'; +$drupal_root = dirname(realpath(__FILE__)); + +include_once $drupal_root . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); if (isset($_GET['cron_key']) && variable_get('cron_key', 'drupal') == $_GET['cron_key']) { drupal_cron_run(); Index: index.php =================================================================== RCS file: /cvs/drupal/drupal/index.php,v retrieving revision 1.94 diff -u -u -r1.94 index.php --- index.php 26 Dec 2007 08:46:48 -0000 1.94 +++ index.php 17 May 2008 15:55:36 -0000 @@ -12,7 +12,8 @@ * See COPYRIGHT.txt and LICENSE.txt. */ -require_once './includes/bootstrap.inc'; +$drupal_root = dirname(realpath(__FILE__)); +require_once $drupal_root .'/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $return = menu_execute_active_handler(); Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.118 diff -u -u -r1.118 install.php --- install.php 6 May 2008 12:18:44 -0000 1.118 +++ install.php 17 May 2008 15:55:36 -0000 @@ -1,7 +1,8 @@ filename); + include_once($drupal_root . $profile->filename); // Load profile details. $function = $profile->name . '_profile_details'; if (function_exists($function)) { @@ -492,8 +496,9 @@ * The selected language. */ function install_select_locale($profilename) { - include_once './includes/file.inc'; - include_once './includes/form.inc'; + global $drupal_root; + include_once $drupal_root . '/includes/file.inc'; + include_once $drupal_root . '/includes/form.inc'; // Find all available locales. $locales = install_find_locales($profilename); @@ -557,7 +562,8 @@ * Form API array definition for language selection. */ function install_select_locale_form(&$form_state, $locales) { - include_once './includes/locale.inc'; + global $drupal_root; + include_once $drupal_root . '/includes/locale.inc'; $languages = _locale_get_predefined_list(); foreach ($locales as $locale) { // Try to use verbose locale name @@ -606,7 +612,7 @@ * Tasks performed after the database is initialized. */ function install_tasks($profile, $task) { - global $base_url, $install_locale; + global $base_url, $install_locale, $drupal_root; // Bootstrap newly installed Drupal, while preserving existing messages. $messages = isset($_SESSION['messages']) ? $_SESSION['messages'] : ''; @@ -651,14 +657,14 @@ // to the same address, until the batch finished callback is invoked // and the task advances to 'locale-initial-import'. if ($task == 'profile-install-batch') { - include_once 'includes/batch.inc'; + include_once $drupal_root .'/includes/batch.inc'; $output = _batch_page(); } // Import interface translations for the enabled modules. if ($task == 'locale-initial-import') { if (!empty($install_locale) && ($install_locale != 'en')) { - include_once 'includes/locale.inc'; + include_once $drupal_root . 'includes/locale.inc'; // Enable installation language as default site language. locale_add_language($install_locale, NULL, NULL, NULL, NULL, NULL, 1, TRUE); // Collect files to import for this language. @@ -677,8 +683,8 @@ $task = 'configure'; } if ($task == 'locale-initial-batch') { - include_once 'includes/batch.inc'; - include_once 'includes/locale.inc'; + include_once $drupal_root . 'includes/batch.inc'; + include_once $drupal_root . 'includes/locale.inc'; $output = _batch_page(); } @@ -751,7 +757,7 @@ // control and proceed with importing the remaining translations. if ($task == 'profile-finished') { if (!empty($install_locale) && ($install_locale != 'en')) { - include_once 'includes/locale.inc'; + include_once $drupal_root . 'includes/locale.inc'; // Collect files to import for this language. Skip components // already covered in the initial batch set. $batch = locale_batch_by_language($install_locale, '_install_locale_remaining_batch_finished', variable_get('install_locale_batch_components', array())); @@ -769,8 +775,8 @@ $task = 'finished'; } if ($task == 'locale-remaining-batch') { - include_once 'includes/batch.inc'; - include_once 'includes/locale.inc'; + include_once $drupal_root . '/includes/batch.inc'; + include_once $drupal_root . '/includes/locale.inc'; $output = _batch_page(); } Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.254 diff -u -u -r1.254 update.php --- update.php 14 Apr 2008 17:48:33 -0000 1.254 +++ update.php 17 May 2008 15:55:36 -0000 @@ -1,6 +1,8 @@ uid == 1) { - include_once './includes/install.inc'; - include_once './includes/batch.inc'; + include_once $drupal_root . '/includes/install.inc'; + include_once $drupal_root . '/includes/batch.inc'; drupal_load_updates(); update_fix_d6_requirements(); Index: xmlrpc.php =================================================================== RCS file: /cvs/drupal/drupal/xmlrpc.php,v retrieving revision 1.15 diff -u -u -r1.15 xmlrpc.php --- xmlrpc.php 10 Dec 2005 19:26:47 -0000 1.15 +++ xmlrpc.php 17 May 2008 15:55:36 -0000 @@ -6,9 +6,10 @@ * PHP page for handling incoming XML-RPC requests from clients. */ -include_once './includes/bootstrap.inc'; +$drupal_root = dirname(realpath(__FILE__)); +include_once $drupal_root . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); -include_once './includes/xmlrpc.inc'; -include_once './includes/xmlrpcs.inc'; +include_once $drupal_root . '/includes/xmlrpc.inc'; +include_once $drupal_root . '/includes/xmlrpcs.inc'; xmlrpc_server(module_invoke_all('xmlrpc')); Index: includes/batch.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/batch.inc,v retrieving revision 1.15 diff -u -u -r1.15 batch.inc --- includes/batch.inc 14 Apr 2008 17:48:33 -0000 1.15 +++ includes/batch.inc 17 May 2008 15:55:36 -0000 @@ -163,6 +163,7 @@ * was not set for progressive execution - e.g forms submitted by drupal_execute). */ function _batch_process() { + global $drupal_root; $batch =& batch_get(); $current_set =& _batch_current_set(); $set_changed = TRUE; @@ -176,7 +177,7 @@ // request, we check if it requires an additional file for functions // definitions. if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) { - include_once($current_set['file']); + include_once( $drupal_root . $current_set['file']); } $finished = 1; @@ -288,6 +289,7 @@ * and resolve page redirection. */ function _batch_finished() { + global $drupal_root; $batch =& batch_get(); // Execute the 'finished' callbacks for each batch set. @@ -295,7 +297,7 @@ if (isset($batch_set['finished'])) { // Check if the set requires an additional file for functions definitions. if (isset($batch_set['file']) && is_file($batch_set['file'])) { - include_once($batch_set['file']); + include_once($drupal_root . $batch_set['file']); } if (function_exists($batch_set['finished'])) { $batch_set['finished']($batch_set['success'], $batch_set['results'], $batch_set['operations']); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.210 diff -u -u -r1.210 bootstrap.inc --- includes/bootstrap.inc 13 May 2008 17:38:42 -0000 1.210 +++ includes/bootstrap.inc 17 May 2008 15:55:36 -0000 @@ -271,14 +271,14 @@ * session name correctly. */ function conf_init() { - global $base_url, $base_path, $base_root; + global $base_url, $base_path, $base_root, $drupal_root; // Export the following settings.php variables to the global namespace global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access; $conf = array(); - if (file_exists('./' . conf_path() . '/settings.php')) { - include_once './' . conf_path() . '/settings.php'; + if (file_exists($drupal_root . '/' . conf_path() . '/settings.php')) { + include_once $drupal_root . '/' . conf_path() . '/settings.php'; } if (isset($base_url)) { @@ -536,6 +536,7 @@ * TRUE if the item is loaded or has already been loaded. */ function drupal_load($type, $name) { + global $drupal_root; static $files = array(); if (isset($files[$type][$name])) { @@ -545,7 +546,7 @@ $filename = drupal_get_filename($type, $name); if ($filename) { - include_once "./$filename"; + include_once $drupal_root . "/$filename"; $files[$type][$name] = TRUE; return TRUE; @@ -919,7 +920,7 @@ } function _drupal_bootstrap($phase) { - global $conf; + global $conf, $drupal_root; switch ($phase) { @@ -934,7 +935,7 @@ case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE: // Allow specifying special cache handlers in settings.php, like // using memcached or files for storing cache information. - require_once variable_get('cache_inc', './includes/cache.inc'); + require_once $drupal_root .'/'. variable_get('cache_inc', '/includes/cache.inc'); // If the page_cache_fastpath is set to TRUE in settings.php and // page_cache_fastpath (implemented in the special implementation of // cache.inc) printed the page and indicated this with a returned TRUE @@ -946,7 +947,7 @@ case DRUPAL_BOOTSTRAP_DATABASE: // Initialize the default database. - require_once './includes/database.inc'; + require_once $drupal_root . '/includes/database.inc'; db_set_active(); // Register autoload functions so that we can access classes and interfaces. spl_autoload_register('drupal_autoload_class'); @@ -963,7 +964,7 @@ break; case DRUPAL_BOOTSTRAP_SESSION: - require_once variable_get('session_inc', './includes/session.inc'); + require_once $drupal_root . '/' . variable_get('session_inc', 'includes/session.inc'); session_set_save_handler('sess_open', 'sess_close', 'sess_read', 'sess_write', 'sess_destroy_sid', 'sess_gc'); session_start(); break; @@ -972,7 +973,7 @@ // Initialize configuration variables, using values from settings.php if available. $conf = variable_init(isset($conf) ? $conf : array()); // Load module handling. - require_once './includes/module.inc'; + require_once $drupal_root . '/includes/module.inc'; $cache_mode = variable_get('cache', CACHE_DISABLED); // Get the page from the cache. $cache = $cache_mode == CACHE_DISABLED ? '' : page_get_cache(); @@ -999,13 +1000,13 @@ break; case DRUPAL_BOOTSTRAP_PATH: - require_once './includes/path.inc'; + require_once $drupal_root . '/includes/path.inc'; // Initialize $_GET['q'] prior to loading modules and invoking hook_init(). drupal_init_path(); break; case DRUPAL_BOOTSTRAP_FULL: - require_once './includes/common.inc'; + require_once $drupal_root . '/includes/common.inc'; _drupal_bootstrap_full(); break; } @@ -1020,7 +1021,8 @@ * @see _drupal_maintenance_theme() */ function drupal_maintenance_theme() { - require_once './includes/theme.maintenance.inc'; + global $drupal_root; + require_once $drupal_root . '/includes/theme.maintenance.inc'; _drupal_maintenance_theme(); } @@ -1040,7 +1042,7 @@ * Choose a language for the current page, based on site and user preferences. */ function drupal_init_language() { - global $language, $user; + global $language, $user, $drupal_root; // Ensure the language is correctly returned, even without multilanguage support. // Useful for eg. XML/HTML 'lang' attributes. @@ -1048,7 +1050,7 @@ $language = language_default(); } else { - include_once './includes/language.inc'; + include_once $drupal_root . '/includes/language.inc'; $language = language_initialize(); } } @@ -1156,6 +1158,7 @@ * TRUE if the function is now available, FALSE otherwise. */ function drupal_function_exists($function) { + global $drupal_root; static $checked = array(); if (defined('MAINTENANCE_MODE')) { @@ -1175,7 +1178,7 @@ $file = db_result(db_query("SELECT filename FROM {registry} WHERE name = '%s' AND type = '%s'", $function, 'function')); if ($file) { - require_once($file); + require_once($drupal_root .'/'. $file); $checked[$function] = function_exists($function); if ($checked[$function]) { registry_mark_code('function', $function); @@ -1223,7 +1226,7 @@ function _registry_check_code($type, $name) { $file = db_result(db_query("SELECT filename FROM {registry} WHERE name = '%s' AND type = '%s'", $name, $type)); if ($file) { - require_once($file); + require_once($drupal_root . $file); registry_mark_code($type, $name); return TRUE; } @@ -1263,7 +1266,8 @@ * each function, file, and hook implementation in the database. */ function drupal_rebuild_code_registry() { - require_once './includes/registry.inc'; + global $drupal_root; + require_once $drupal_root . '/includes/registry.inc'; _drupal_rebuild_code_registry(); } @@ -1325,6 +1329,7 @@ * registry_load_path_files */ function registry_load_path_files($return = FALSE) { + global $drupal_root; static $file_cache_data = array(); if ($return) { sort($file_cache_data); @@ -1334,7 +1339,7 @@ $cache = cache_get('registry:' . $menu['path'], 'cache_registry'); if (!empty($cache->data)) { foreach(explode(';', $cache->data) as $file) { - require_once($file); + require_once($drupal_root . '/' . $file); $file_cache_data[] = $file; } } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.768 diff -u -u -r1.768 common.inc --- includes/common.inc 16 May 2008 01:23:31 -0000 1.768 +++ includes/common.inc 17 May 2008 15:55:36 -0000 @@ -2417,28 +2417,30 @@ * failed. See xmlrpc_error(). */ function xmlrpc($url) { - require_once './includes/xmlrpc.inc'; + global $drupal_root; + require_once $drupal_root . '/includes/xmlrpc.inc'; $args = func_get_args(); return call_user_func_array('_xmlrpc', $args); } function _drupal_bootstrap_full() { + global $drupal_root; static $called; if ($called) { return; } $called = 1; - require_once './includes/theme.inc'; - require_once './includes/pager.inc'; - require_once './includes/menu.inc'; - require_once './includes/tablesort.inc'; - require_once './includes/file.inc'; - require_once './includes/unicode.inc'; - require_once './includes/image.inc'; - require_once './includes/form.inc'; - require_once './includes/mail.inc'; - require_once './includes/actions.inc'; + require_once $drupal_root . '/includes/theme.inc'; + require_once $drupal_root . '/includes/pager.inc'; + require_once $drupal_root . '/includes/menu.inc'; + require_once $drupal_root . '/includes/tablesort.inc'; + require_once $drupal_root . '/includes/file.inc'; + require_once $drupal_root . '/includes/unicode.inc'; + require_once $drupal_root . '/includes/image.inc'; + require_once $drupal_root . '/includes/form.inc'; + require_once $drupal_root . '/includes/mail.inc'; + require_once $drupal_root . '/includes/actions.inc'; // Set the Drupal custom error handler. set_error_handler('drupal_error_handler'); // Emit the correct charset HTTP header. Index: includes/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.inc,v retrieving revision 1.94 diff -u -u -r1.94 database.inc --- includes/database.inc 20 Apr 2008 18:23:21 -0000 1.94 +++ includes/database.inc 17 May 2008 15:55:37 -0000 @@ -122,11 +122,11 @@ * @return the name of the previously active database or FALSE if non was found. */ function db_set_active($name = 'default') { - global $db_url, $db_type, $active_db, $db_prefix; + global $db_url, $db_type, $active_db, $db_prefix, $drupal_root; static $db_conns, $active_name = FALSE; if (empty($db_url)) { - include_once 'includes/install.inc'; + include_once $drupal_root . '/includes/install.inc'; install_goto('install.php'); } @@ -140,7 +140,7 @@ } $db_type = substr($connect_url, 0, strpos($connect_url, '://')); - $handler = "./includes/database.$db_type.inc"; + $handler = $drupal_root . "/includes/database.$db_type.inc"; if (is_file($handler)) { include_once $handler; Index: includes/database.mysql.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v retrieving revision 1.91 diff -u -u -r1.91 database.mysql.inc --- includes/database.mysql.inc 14 Apr 2008 17:48:33 -0000 1.91 +++ includes/database.mysql.inc 17 May 2008 15:55:37 -0000 @@ -12,7 +12,7 @@ */ // Include functions shared between mysql and mysqli. -require_once './includes/database.mysql-common.inc'; +require_once $drupal_root . '/includes/database.mysql-common.inc'; /** * Report database status. Index: includes/database.mysqli.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.mysqli.inc,v retrieving revision 1.57 diff -u -u -r1.57 database.mysqli.inc --- includes/database.mysqli.inc 14 Apr 2008 17:48:33 -0000 1.57 +++ includes/database.mysqli.inc 17 May 2008 15:55:37 -0000 @@ -15,7 +15,7 @@ */ // Include functions shared between mysql and mysqli. -require_once './includes/database.mysql-common.inc'; +require_once $drupal_root . '/includes/database.mysql-common.inc'; /** * Report database status. Index: includes/database.pgsql.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.pgsql.inc,v retrieving revision 1.71 diff -u -u -r1.71 database.pgsql.inc --- includes/database.pgsql.inc 9 May 2008 19:18:11 -0000 1.71 +++ includes/database.pgsql.inc 17 May 2008 15:55:37 -0000 @@ -45,6 +45,7 @@ * Initialize a database connection. */ function db_connect($url) { + global $drupal_root; // Check if PostgreSQL support is present in PHP if (!function_exists('pg_connect')) { _db_error_page('Unable to use the PostgreSQL database because the PostgreSQL extension for PHP is not installed. Check your php.ini to see how you can enable it.'); @@ -78,7 +79,7 @@ $connection = @pg_connect($conn_string); if (!$connection) { - require_once './includes/unicode.inc'; + require_once $drupal_root . '/includes/unicode.inc'; _db_error_page(decode_entities($php_errormsg)); } Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.272 diff -u -u -r1.272 form.inc --- includes/form.inc 6 May 2008 12:18:45 -0000 1.272 +++ includes/form.inc 17 May 2008 15:55:37 -0000 @@ -2455,6 +2455,7 @@ * URL of the batch processing page. */ function batch_process($redirect = NULL, $url = NULL) { + global $drupal_root; $batch =& batch_get(); if (isset($batch)) { @@ -2500,7 +2501,7 @@ else { // Non-progressive execution: bypass the whole progressbar workflow // and execute the batch in one pass. - require_once './includes/batch.inc'; + require_once $drupal_root . '/includes/batch.inc'; _batch_process(); } } Index: includes/image.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/image.inc,v retrieving revision 1.25 diff -u -u -r1.25 image.inc --- includes/image.inc 14 Apr 2008 17:48:33 -0000 1.25 +++ includes/image.inc 17 May 2008 15:55:37 -0000 @@ -37,11 +37,12 @@ * An array of toolkit name => descriptive title. */ function image_get_available_toolkits() { + global $drupal_root; $toolkits = file_scan_directory('includes', 'image\..*\.inc$'); $output = array(); foreach ($toolkits as $file => $toolkit) { - include_once "./$file"; + include_once $drupal_root .'/'. $file; $function = str_replace('.', '_', $toolkit->name) . '_info'; if (function_exists($function)) { $info = $function(); @@ -63,7 +64,7 @@ if (!$toolkit) { $toolkit = variable_get('image_toolkit', 'gd'); - $toolkit_file = './includes/image.' . $toolkit . '.inc'; + $toolkit_file = $drupal_root . '/includes/image.' . $toolkit . '.inc'; if (isset($toolkit) && file_exists($toolkit_file)) { include_once $toolkit_file; } Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.61 diff -u -u -r1.61 install.inc --- includes/install.inc 6 May 2008 12:18:45 -0000 1.61 +++ includes/install.inc 17 May 2008 15:55:37 -0000 @@ -149,11 +149,12 @@ * An array of database types compiled into PHP. */ function drupal_detect_database_types() { + global $drupal_root; $databases = array(); foreach (array('mysql', 'mysqli', 'pgsql') as $type) { - if (file_exists('./includes/install.' . $type . '.inc')) { - include_once './includes/install.' . $type . '.inc'; + if (file_exists($drupal_root . '/includes/install.' . $type . '.inc')) { + include_once $drupal_root . '/includes/install.' . $type . '.inc'; $function = $type . '_is_available'; if ($function()) { $databases[$type] = $type; @@ -267,10 +268,11 @@ * The list of modules to install. */ function drupal_verify_profile($profile, $locale) { - include_once './includes/file.inc'; - include_once './includes/common.inc'; + global $drupal_root; + include_once $drupal_root . '/includes/file.inc'; + include_once $drupal_root . '/includes/common.inc'; - $profile_file = "./profiles/$profile/$profile.profile"; + $profile_file = $drupal_root . "/profiles/$profile/$profile.profile"; if (!isset($profile) || !file_exists($profile_file)) { install_no_profile_error(); @@ -355,7 +357,7 @@ */ function drupal_install_system() { $system_path = dirname(drupal_get_filename('module', 'system', NULL)); - require_once './' . $system_path . '/system.install'; + require_once $system_path . '/system.install'; module_invoke('system', 'install'); $system_versions = drupal_get_schema_versions('system'); $system_version = $system_versions ? max($system_versions) : SCHEMA_INSTALLED; @@ -626,20 +628,20 @@ */ function st($string, $args = array()) { static $locale_strings = NULL; - global $profile, $install_locale; + global $profile, $install_locale, $drupal_root; if (!isset($locale_strings)) { $locale_strings = array(); $filename = './profiles/' . $profile . '/translations/' . $install_locale . '.po'; if (file_exists($filename)) { - require_once './includes/locale.inc'; + require_once $drupal_root . '/includes/locale.inc'; $file = (object) array('filepath' => $filename); _locale_import_read_po('mem-store', $file); $locale_strings = _locale_import_one_string('mem-report'); } } - require_once './includes/theme.inc'; + require_once $drupal_root . '/includes/theme.inc'; // Transform arguments before inserting them foreach ($args as $key => $value) { switch ($key[0]) { @@ -666,9 +668,10 @@ * Name of profile to check. */ function drupal_check_profile($profile) { - include_once './includes/file.inc'; + global $drupal_root; + include_once $drupal_root . '/includes/file.inc'; - $profile_file = "./profiles/$profile/$profile.profile"; + $profile_file = $drupal_root . "/profiles/$profile/$profile.profile"; if (!isset($profile) || !file_exists($profile_file)) { install_no_profile_error(); @@ -686,7 +689,7 @@ // Collect requirement testing results $requirements = array(); foreach ($installs as $install) { - require_once $install->filename; + require_once $drupal_root .'/'. $install->filename; $function = $install->name. '_requirements'; if (function_exists($function)) { $requirements = array_merge($requirements, $function('install')); @@ -712,10 +715,11 @@ * Check a module's requirements. */ function drupal_check_module($module) { + global $drupal_root; // Include install file $install = drupal_get_install_files(array($module)); if (isset($install[$module])) { - require_once $install[$module]->filename; + require_once $drupal_root .'/'. $install[$module]->filename; // Check requirements $requirements = module_invoke($module, 'requirements', 'install'); Index: includes/mail.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/mail.inc,v retrieving revision 1.13 diff -u -u -r1.13 mail.inc --- includes/mail.inc 6 May 2008 12:18:45 -0000 1.13 +++ includes/mail.inc 17 May 2008 15:55:37 -0000 @@ -171,9 +171,10 @@ * FALSE otherwise. */ function drupal_mail_send($message) { + global $drupal_root; // Allow for a custom mail backend. if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) { - include_once './' . variable_get('smtp_library', ''); + include_once $drupal_root . '/' . variable_get('smtp_library', ''); return drupal_mail_wrapper($message); } else { Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.120 diff -u -u -r1.120 module.inc --- includes/module.inc 13 May 2008 17:38:42 -0000 1.120 +++ includes/module.inc 17 May 2008 15:55:37 -0000 @@ -228,8 +228,9 @@ * Load a module's installation hooks. */ function module_load_install($module) { + global $drupal_root; // Make sure the installation API is available - include_once './includes/install.inc'; + include_once $drupal_root . '/includes/install.inc'; module_load_include('install', $module); } @@ -249,7 +250,7 @@ $name = $module; } - $file = './' . drupal_get_path('module', $module) . "/$name.$type"; + $file = drupal_get_path('module', $module) . "/$name.$type"; if (is_file($file)) { require_once $file; Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.422 diff -u -u -r1.422 theme.inc --- includes/theme.inc 6 May 2008 12:18:45 -0000 1.422 +++ includes/theme.inc 17 May 2008 15:55:37 -0000 @@ -86,7 +86,7 @@ * The callback to invoke to set the theme registry. */ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme_load_registry') { - global $theme_info, $base_theme_info, $theme_engine, $theme_path; + global $theme_info, $base_theme_info, $theme_engine, $theme_path, $drupal_root; $theme_info = $theme; $base_theme_info = $base_theme; @@ -153,7 +153,7 @@ // Initialize the theme. if (isset($theme->engine)) { // Include the engine. - include_once './' . $theme->owner; + include_once $drupal_root . '/' . $theme->owner; $theme_engine = $theme->engine; if (function_exists($theme_engine . '_init')) { @@ -168,12 +168,12 @@ foreach ($base_theme as $base) { // Include the theme file or the engine. if (!empty($base->owner)) { - include_once './' . $base->owner; + include_once $drupal_root . '/' . $base->owner; } } // and our theme gets one too. if (!empty($theme->owner)) { - include_once './' . $theme->owner; + include_once $drupal_root . '/' . $theme->owner; } } @@ -263,6 +263,7 @@ * over how and when the preprocess functions are run. */ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { + global $drupal_root; $function = $name . '_theme'; if (function_exists($function)) { $result = $function($cache, $type, $theme, $path); @@ -285,7 +286,7 @@ include_once($result[$hook]['file']); } elseif (isset($info['file']) && isset($info['path'])) { - include_once($info['path'] . '/' . $info['file']); + include_once($drupal_root . $info['path'] . '/' . $info['file']); } if (isset($info['template']) && !isset($info['path'])) { @@ -552,10 +553,12 @@ * An HTML string that generates the themed output. */ function theme() { + global $drupal_root; + static $hooks = NULL; + $args = func_get_args(); $hook = array_shift($args); - static $hooks = NULL; if (!isset($hooks)) { init_theme(); $hooks = theme_get_registry(); Index: includes/theme.maintenance.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v retrieving revision 1.13 diff -u -u -r1.13 theme.maintenance.inc --- includes/theme.maintenance.inc 28 Apr 2008 09:25:26 -0000 1.13 +++ includes/theme.maintenance.inc 17 May 2008 15:55:37 -0000 @@ -15,20 +15,20 @@ * $conf variable in order to change the maintenance theme. */ function _drupal_maintenance_theme() { - global $theme, $theme_key; + global $theme, $theme_key, $drupal_root; // If $theme is already set, assume the others are set too, and do nothing. if (isset($theme)) { return; } - require_once './includes/path.inc'; - require_once './includes/theme.inc'; - require_once './includes/common.inc'; - require_once './includes/unicode.inc'; - require_once './includes/file.inc'; - require_once './includes/module.inc'; - require_once './includes/database.inc'; + require_once $drupal_root . '/includes/path.inc'; + require_once $drupal_root . '/includes/theme.inc'; + require_once $drupal_root . '/includes/common.inc'; + require_once $drupal_root . '/includes/unicode.inc'; + require_once $drupal_root . '/includes/file.inc'; + require_once $drupal_root . '/includes/module.inc'; + require_once $drupal_root . '/includes/database.inc'; unicode_check(); // Install and update pages are treated differently to prevent theming overrides.