Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.198
diff -u -r1.198 file.inc
--- includes/file.inc	23 Oct 2009 01:00:52 -0000	1.198
+++ includes/file.inc	30 Oct 2009 22:39:08 -0000
@@ -1685,9 +1685,14 @@
   static $max_size = -1;
 
   if ($max_size < 0) {
+    $max_size = parse_size(ini_get('post_max_size'));
+
+    // A zero value indicates no limit
     $upload_max = parse_size(ini_get('upload_max_filesize'));
-    $post_max = parse_size(ini_get('post_max_size'));
-    $max_size = ($upload_max < $post_max) ? $upload_max : $post_max;
+    if ($upload_max > 0 && $upload_max < $max_size)
+    {
+      $max_size = $upload_max;
+    }
   }
   return $max_size;
 }