Author: fabien
Date: 2010-03-03 15:42:10 +0100 (Wed, 03 Mar 2010)
New Revision: 28365

Modified:
   branches/1.3/lib/controller/sfController.class.php
   branches/1.4/lib/controller/sfController.class.php
Log:
[1.3, 1.4] added a way to change the default max forward in the controller for 
edge cases (#8302)

Modified: branches/1.3/lib/controller/sfController.class.php
===================================================================
--- branches/1.3/lib/controller/sfController.class.php  2010-03-03 13:40:33 UTC 
(rev 28364)
+++ branches/1.3/lib/controller/sfController.class.php  2010-03-03 14:42:10 UTC 
(rev 28365)
@@ -24,7 +24,8 @@
     $context           = null,
     $dispatcher        = null,
     $controllerClasses = array(),
-    $renderMode        = sfView::RENDER_CLIENT;
+    $renderMode        = sfView::RENDER_CLIENT,
+    $maxForwards       = 5;
 
   /**
    * Class constructor.
@@ -172,7 +173,7 @@
     $moduleName = preg_replace('/[^a-z0-9_]+/i', '', $moduleName);
     $actionName = preg_replace('/[^a-z0-9_]+/i', '', $actionName);
 
-    if ($this->getActionStack()->getSize() >= 5)
+    if ($this->getActionStack()->getSize() >= $this->maxForwards)
     {
       // let's kill this party before it turns into cpu cycle hell
       throw new sfForwardException('Too many forwards have been detected for 
this request.');

Modified: branches/1.4/lib/controller/sfController.class.php
===================================================================
--- branches/1.4/lib/controller/sfController.class.php  2010-03-03 13:40:33 UTC 
(rev 28364)
+++ branches/1.4/lib/controller/sfController.class.php  2010-03-03 14:42:10 UTC 
(rev 28365)
@@ -24,7 +24,8 @@
     $context           = null,
     $dispatcher        = null,
     $controllerClasses = array(),
-    $renderMode        = sfView::RENDER_CLIENT;
+    $renderMode        = sfView::RENDER_CLIENT,
+    $maxForwards       = 5;
 
   /**
    * Class constructor.
@@ -172,7 +173,7 @@
     $moduleName = preg_replace('/[^a-z0-9_]+/i', '', $moduleName);
     $actionName = preg_replace('/[^a-z0-9_]+/i', '', $actionName);
 
-    if ($this->getActionStack()->getSize() >= 5)
+    if ($this->getActionStack()->getSize() >= $this->maxForwards)
     {
       // let's kill this party before it turns into cpu cycle hell
       throw new sfForwardException('Too many forwards have been detected for 
this request.');

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to