Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.298
diff -u -p -r1.298 filter.module
--- modules/filter/filter.module	16 Oct 2009 19:06:23 -0000	1.298
+++ modules/filter/filter.module	20 Oct 2009 06:22:21 -0000
@@ -429,13 +429,13 @@ function filter_get_formats_by_role($rid
  * @see filter_fallback_format()
  */
 function filter_default_format($account = NULL) {
-  global $user;
   if (!isset($account)) {
+    global $user;
     $account = $user;
   }
   // Get a list of formats for this user, ordered by weight. The first one
   // available is the user's default format.
-  $format = array_shift(filter_formats($account));
+  $format = reset(filter_formats($account));
   return $format->format;
 }
 
