From d341f531d360bdb1070636ff98153f13179d3999 Mon Sep 17 00:00:00 2001 From: nate Date: Sat, 26 Apr 2008 11:10:55 +0000 Subject: [PATCH] Fixing recursion in Debugger variable dumps git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6719 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/debugger.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 1ef6571a3..817070a3d 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -367,11 +367,14 @@ class Debugger extends Object { $out = "array("; $vars = array(); foreach ($var as $key => $val) { - if (is_numeric($key)) { - $vars[] = "\n\t" . $_this->exportVar($val, $recursion - 1); - } else { - $vars[] = "\n\t" .$_this->exportVar($key) . ' => ' . $_this->exportVar($val, $recursion - 1); - } + if ($recursion >= 0) { + if (is_numeric($key)) { + $vars[] = "\n\t" . $_this->exportVar($val, $recursion - 1); + } else { + $vars[] = "\n\t" .$_this->exportVar($key, $recursion - 1) + . ' => ' . $_this->exportVar($val, $recursion - 1); + } + } } $n = null; if (count($vars) > 0) {