Development

#796 (sffunctionCache doesn't handle exceptions very well)

You must first sign up to be able to contribute.

Ticket #796 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

sffunctionCache doesn't handle exceptions very well

Reported by: pookey Assigned to:
Priority: minor Milestone: 1.0.0
Component: Version:
Keywords: Cc:
Qualification:

Description

sfFunctionCache will leave a ob_ buffer open, which does horrrible nasty things to page rendering, took me aaaaaaaages to figure out what was going on :)

Index: lib/symfony/cache/sfFunctionCache.class.php
===================================================================
--- lib/symfony/cache/sfFunctionCache.class.php (revision 1649)
+++ lib/symfony/cache/sfFunctionCache.class.php (working copy)
@@ -57,7 +57,14 @@
       {
         // classname::staticMethod
         list($class, $method) = explode('::', $target);
-        $result = call_user_func_array(array($class, $method), $arguments);
+        try {
+          $result = call_user_func_array(array($class, $method), $arguments);
+        }
+        catch (Exception $e)
+        {
+          ob_end_clean();
+          throw $e;
+        }
       }
       else if (strstr($target, '->'))
       {
@@ -66,7 +73,14 @@
         // name is the same as this var name
         list($object_123456789, $method) = explode('->', $target);
         global $$object_123456789;
-        $result = call_user_func_array(array($$object_123456789, $method), $arguments);
+        try {
+          $result = call_user_func_array(array($$object_123456789, $method), $arguments);
+        }
+        catch (Exception $e)
+        {
+          ob_end_clean();
+          throw $e;
+        }
       }
       else
       {

Change History

08/21/06 12:10:20 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [1697]) fixed sffunctionCache doesn't handle exceptions very well (closes #796 - patch from pookey)

08/21/06 12:10:35 changed by fabien

  • milestone set to 1.0.0.