Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.264
diff -p -u -p -r1.264 filter.module
--- modules/filter/filter.module	27 Jul 2009 20:15:35 -0000	1.264
+++ modules/filter/filter.module	1 Aug 2009 01:03:07 -0000
@@ -290,14 +290,12 @@ function filter_filter_tips($delta, $for
  */
 function filter_formats($index = NULL) {
   global $user;
-  static $formats;
+  $formats = &drupal_static(__FUNCTION__, array());
 
   // Administrators can always use all text formats.
   $all = user_access('administer filters');
 
-  if (!isset($formats)) {
-    $formats = array();
-
+  if (empty($formats)) {
     $query = db_select('filter_format', 'f');
     $query->addField('f', 'format', 'format');
     $query->addField('f', 'name', 'name');
@@ -361,7 +359,7 @@ function filter_resolve_format($format) 
  * Check if text in a certain text format is allowed to be cached.
  */
 function filter_format_allowcache($format) {
-  static $cache = array();
+  $cache = &drupal_static(__FUNCTION__, array());
   $format = filter_resolve_format($format);
   if (!isset($cache[$format])) {
     $cache[$format] = db_query('SELECT cache FROM {filter_format} WHERE format = :format', array(':format' => $format))->fetchField();
@@ -373,7 +371,7 @@ function filter_format_allowcache($forma
  * Retrieve a list of filters for a certain format.
  */
 function filter_list_format($format) {
-  static $filters = array();
+  $filters = &drupal_static(__FUNCTION__, array());
 
   if (!isset($filters[$format])) {
     $filters[$format] = array();
@@ -798,7 +796,7 @@ function _filter_url_parse_partial_links
  * Shortens long URLs to http://www.example.com/long/url...
  */
 function _filter_url_trim($text, $length = NULL) {
-  static $_length;
+  $_length = &drupal_static(__FUNCTION__);
   if ($length !== NULL) {
     $_length = $length;
   }
