From 17913f58603a91451579174a2fa87011312bef64 Mon Sep 17 00:00:00 2001 From: jackbravo Date: Fri, 24 Aug 2007 21:43:50 +0000 Subject: [PATCH] Clearer fix for nesting level too deep bug, use in_array with strict flag (use === instead of ==) --- lib/Doctrine/Connection.php | 5 ++++- lib/Doctrine/Transaction.php | 12 ++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index a5e5042b2..9b7c29705 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -469,7 +469,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun return false; } // column names are specified as array keys - $cols = array_keys($values); + $cols = array(); + foreach ($values as $key => $value) { + $cols[] = $this->quoteIdentifier($key); + } // build the statement $query = 'INSERT INTO ' . $this->quoteIdentifier($table) diff --git a/lib/Doctrine/Transaction.php b/lib/Doctrine/Transaction.php index edec8cf96..628285aef 100644 --- a/lib/Doctrine/Transaction.php +++ b/lib/Doctrine/Transaction.php @@ -129,17 +129,9 @@ class Doctrine_Transaction extends Doctrine_Connection_Module */ public function addInvalid(Doctrine_Record $record) { - /** - * for some weird reason in_array cannot be used here (php bug ?) - * - * if used it results in fatal error : [ nesting level too deep ] - */ - foreach ($this->invalid as $val) { - if ($val === $record) { - return false; - } + if (in_array($record, $this->invalid, true)) { + return false; } - $this->invalid[] = $record; return true; }