|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Zefard Smarty n00b
Joined: 06 Jun 2007 Posts: 1
|
Posted: Wed Jun 06, 2007 12:38 pm Post subject: smarty_modifier_debug_print_var has potential infinite loop |
|
|
When I run following code, Apache is crashed by an inifinite loop.
Code: | <?php
class A {
var $class_b;
function A () {
$this->class_b = new B($this);
}
}
class B {
var $class_a;
function B ($class_a) {
$this->class_a = $class_a;
}
}
require 'Smarty.class.php';
$a = new A();
$smarty = new Smarty;
$smarty->debugging = true;
$smarty->assign("Infinite loop", $a);
$smarty->display('index.tpl');
?>
|
When I turn debugging off, index.tpl is displayed correctly.
smarty_modifier_debug_print_var function calls recursively themself. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Jun 06, 2007 3:34 pm Post subject: |
|
|
Correct. Don't expect this to be fixed. |
|
Back to top |
|
skrebbel Smarty n00b
Joined: 03 Jan 2007 Posts: 4 Location: Eindhoven, the Netherlands
|
Posted: Thu Aug 30, 2007 9:06 am Post subject: |
|
|
why not? wouldn't a simple maximum recursion depth solve the problem?
a
Code: | if($depth > 10) return $var; |
(or a bit more beautified) should do the job, no? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Aug 30, 2007 1:30 pm Post subject: |
|
|
Hmm, this causes the same problem:
index.php
Code: | include 'index.php'; |
Maybe the PHP guys should fix that? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|