? modules/book/book.js ? modules/comment/comment-node-form.js ? modules/menu/menu.js ? modules/node/node.js ? modules/path/path.js ? modules/upload/upload.js Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.163 diff -u -p -r1.163 install.php --- install.php 4 Apr 2009 00:35:45 -0000 1.163 +++ install.php 25 Apr 2009 11:39:08 -0000 @@ -618,7 +618,7 @@ function install_already_done_error() { * Tasks performed after the database is initialized. */ function install_tasks($profile, $task) { - global $base_url, $install_locale; + global $base_url, $install_locale, $conf; // Bootstrap newly installed Drupal, while preserving existing messages. $messages = isset($_SESSION['messages']) ? $_SESSION['messages'] : ''; @@ -697,15 +697,16 @@ function install_tasks($profile, $task) } if ($task == 'configure') { - if (variable_get('site_name', FALSE) || variable_get('site_mail', FALSE)) { + // We need to check if a variable has been saved, because variable_get + // returns a different default value than we need here. + if (isset($conf['site_name']) || isset($conf['site_email'])) { // Site already configured: This should never happen, means re-running // the installer, possibly by an attacker after the 'install_task' variable // got accidentally blown somewhere. Stop it now. install_already_done_error(); } $form = drupal_get_form('install_configure_form', $url); - - if (!variable_get('site_name', FALSE) && !variable_get('site_mail', FALSE)) { + if (!isset($conf['site_name']) && !isset($conf['site_email'])) { // Not submitted yet: Prepare to display the form. $output = $form; drupal_set_title(st('Configure site')); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.277 diff -u -p -r1.277 bootstrap.inc --- includes/bootstrap.inc 24 Apr 2009 08:15:50 -0000 1.277 +++ includes/bootstrap.inc 25 Apr 2009 11:39:11 -0000 @@ -625,14 +625,16 @@ function variable_init($conf = array()) * @param $name * The name of the variable to return. * @param $default - * The default value to use if this variable has never been set. + * The default value for dynamic variables. Static variables defaults should + * be declared in hook_variable_info(). * @return * The value of the variable. */ function variable_get($name, $default = NULL) { global $conf; - return isset($conf[$name]) ? $conf[$name] : $default; + $value = isset($conf[$name]) ? $conf[$name] : variable_default($name); + return !is_null($value) ? $value : $default; } /** @@ -643,15 +645,89 @@ function variable_get($name, $default = * @param $value * The value to set. This can be any PHP data type; these functions take care * of serialization as necessary. + * @return + * The value of the variable. */ function variable_set($name, $value) { global $conf; - db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute(); - + // Do not store default values in the database. + if ($value === variable_default($name)) { + variable_del($name); + } + else { + db_merge('variable') + ->key(array('name' => $name)) + ->fields(array('value' => serialize($value))) + ->execute(); + } + // Clear the cache and reset the variable. cache_clear_all('variables', 'cache'); - $conf[$name] = $value; + return $conf[$name] = $value; +} + +/** + * Gets the default value for a given variable. + * + * @param $name + * The name of the variable in question. + * @return + * The default value for that variable, to be used in case no value is set. + */ +function variable_default($name) { + $defaults = &drupal_static(__FILE__, array()); + $loaded = &drupal_static(__FILE__ . ':loaded', FALSE); + $built = &drupal_static(__FILE__ . ':built', FALSE); + + if (empty($defaults)) { + $built = FALSE; + // These variables need to be initialized here because they are required to + // exist before the database is set up and the variable system initialized. + $defaults['cache_inc'] = './includes/cache.inc'; + $defaults['page_cache_fastpath'] = FALSE; + $defaults['blocked_ips'] = NULL; + $defaults['session_inc'] = './includes/session.inc'; + $defaults['dev_query'] = 0; + $defaults['reverse_proxy'] = 0; + $defaults['reverse_proxy_addresses'] = array(); + $defaults['cache'] = CACHE_DISABLED; + $defaults['cache_flush'] = 0; + $defaults['language_count'] = 1; + $defaults['session_write_interval'] = 180; + $defaults['site_frontpage'] = 'node'; + $defaults['install_profile_modules'] = array(); + $defaults['install_locale_batch_components'] = array(); + $defaults['password_inc'] = './includes/password.inc'; + $defaults['field_storage_module'] = 'field_sql_storage'; + $defaults['language_default'] = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''); + } + // We can only retrieve from the cache if the cache is available. + if (($loaded === FALSE) && function_exists('cache_get') && function_exists('db_query')) { + // Only try to load from cache once, set $loaded to TRUE. + $loaded = TRUE; + if (!defined('MAINTENANCE_MODE') && $cache = cache_get('variable_defaults') && !empty($cache->data)) { + $defaults = $cache->data; + } + } + // We use function_exists() here, because the registry may not be available early on in the page process. + if (($built === FALSE) && !isset($defaults[$name]) && function_exists('module_invoke_all') && function_exists('drupal_alter') && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) { + // already set $built to prevent loops + $built = TRUE; + + // Construct the default variables registry by invoking hook_variable_info() and hook_variable_info_alter(). + $defaults += module_invoke_all('variable_info'); + drupal_alter('variable_info', $defaults); + + // We now have the full variables defaults, so save them to the cache, unless we are in maintenaince mode. + if (!defined('MAINTENANCE_MODE')) { + cache_set('variable_defaults', $defaults, 'cache'); + } + } + if (array_key_exists($name, $defaults)) { + return $defaults[$name]; + } + return NULL; } /** Index: includes/password.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/password.inc,v retrieving revision 1.6 diff -u -p -r1.6 password.inc --- includes/password.inc 26 Feb 2009 07:30:26 -0000 1.6 +++ includes/password.inc 25 Apr 2009 11:39:11 -0000 @@ -15,23 +15,6 @@ */ /** - * The standard log2 number of iterations for password stretching. This should - * increase by 1 at least every other Drupal version in order to counteract - * increases in the speed and power of computers available to crack the hashes. - */ -define('DRUPAL_HASH_COUNT', 14); - -/** - * The minimum allowed log2 number of iterations for password stretching. - */ -define('DRUPAL_MIN_HASH_COUNT', 7); - -/** - * The maximum allowed log2 number of iterations for password stretching. - */ -define('DRUPAL_MAX_HASH_COUNT', 30); - -/** * Returns a string for mapping an int to the corresponding base 64 character. */ function _password_itoa64() { Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.405 diff -u -p -r1.405 aggregator.module --- modules/aggregator/aggregator.module 1 Mar 2009 07:21:02 -0000 1.405 +++ modules/aggregator/aggregator.module 25 Apr 2009 11:39:11 -0000 @@ -30,6 +30,20 @@ function aggregator_help($path, $arg) { } /** + * Implementation of hook_variable_info(). + */ +function aggregator_variable_info() { + return array( + 'aggregator_allowed_html_tags' => '