Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.211.2.2 diff -u -p -r1.211.2.2 update.php --- update.php 8 Apr 2007 00:54:04 -0000 1.211.2.2 +++ update.php 10 Dec 2008 17:45:59 -0000 @@ -562,10 +562,11 @@ function update_finished_page($success) function update_info_page() { drupal_set_title('Drupal database update'); + $link = 'update.php?op=selection&token='. drupal_get_token('update'); $output = "
    \n"; $output .= "
  1. Use this script to upgrade an existing Drupal installation. You don't need this script when installing Drupal from scratch.
  2. "; $output .= "
  3. Before doing anything, backup your database. This process will change your database and its values, and some things might get lost.
  4. \n"; - $output .= "
  5. Update your Drupal sources, check the notes below and run the database upgrade script. Don't upgrade your database twice as it may cause problems.
  6. \n"; + $output .= "
  7. Update your Drupal sources, check the notes below and run the database upgrade script. Don't upgrade your database twice as it may cause problems.
  8. \n"; $output .= "
  9. Go through the various administration pages to change the existing and new settings to your liking.
  10. \n"; $output .= "
"; $output .= '

For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

'; @@ -793,10 +794,6 @@ if (($access_check == FALSE) || ($user-> $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; switch ($op) { - case 'Update': - $output = update_update_page(); - break; - case 'finished': $output = update_finished_page(TRUE); break; @@ -813,10 +810,18 @@ if (($access_check == FALSE) || ($user-> $output = update_progress_page_nojs(); break; + case 'Update': + if ($_GET['token'] == drupal_get_token('update')) { + $output = update_update_page(); + break; + } + // If the token did not match we just display the default page. case 'selection': - $output = update_selection_page(); - break; - + if ($_GET['token'] == drupal_get_token('update')) { + $output = update_selection_page(); + break; + } + // If the token did not match we just display the default page. default: $output = update_info_page(); break; Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.160.2.10 diff -u -p -r1.160.2.10 filter.module --- modules/filter/filter.module 17 Sep 2008 19:14:19 -0000 1.160.2.10 +++ modules/filter/filter.module 10 Dec 2008 17:46:05 -0000 @@ -709,13 +709,20 @@ function filter_list_format($format) { static $filters = array(); if (!isset($filters[$format])) { - $filters[$format] = array(); $result = db_query("SELECT * FROM {filters} WHERE format = %d ORDER BY weight ASC", $format); - while ($filter = db_fetch_object($result)) { - $list = module_invoke($filter->module, 'filter', 'list'); - if (isset($list) && is_array($list) && isset($list[$filter->delta])) { - $filter->name = $list[$filter->delta]; - $filters[$format][$filter->module .'/'. $filter->delta] = $filter; + if (db_num_rows($result) == 0 && !db_result(db_query("SELECT 1 FROM {filter_formats} WHERE format = %d", $format))) { + // The format has no filters and does not exist, use the default input + // format. + $filters[$format] = filter_list_format(variable_get('filter_default_format', 1)); + } + else { + $filters[$format] = array(); + while ($filter = db_fetch_object($result)) { + $list = module_invoke($filter->module, 'filter', 'list'); + if (isset($list) && is_array($list) && isset($list[$filter->delta])) { + $filter->name = $list[$filter->delta]; + $filters[$format][$filter->module .'/'. $filter->delta] = $filter; + } } } }