cvs: pear /DB_DBA DBA_Relational.php

From: Date: Mon, 08 Jul 2002 03:37:00 +0000
Subject: cvs: pear /DB_DBA DBA_Relational.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4962@lists.php.net to get a copy of this message
busterb Sun Jul 7 23:37:00 2002 EDT Modified files: /pear/DB_DBA DBA_Relational.php Log: further check for valid table names when opening Index: pear/DB_DBA/DBA_Relational.php diff -u pear/DB_DBA/DBA_Relational.php:1.28 pear/DB_DBA/DBA_Relational.php:1.29 --- pear/DB_DBA/DBA_Relational.php:1.28 Sun Jul 7 14:16:43 2002 +++ pear/DB_DBA/DBA_Relational.php Sun Jul 7 23:37:00 2002 @@ -18,7 +18,7 @@ // | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA| // +----------------------------------------------------------------------+ // -// $Id: DBA_Relational.php,v 1.28 2002/07/07 18:16:43 busterb Exp $ +// $Id: DBA_Relational.php,v 1.29 2002/07/08 03:37:00 busterb Exp $ require_once 'PEAR.php'; require_once 'DB/DBA/DBA_Table.php'; @@ -123,12 +123,17 @@ */ function _openTable($tableName, $mode = 'r') { - if (!isset($this->_tables[$tableName])) { - if (!$this->_manager->tableExists($this->_home.$tableName)) { - return $this->raiseError("DBA: table '$tableName' does not exist"); - } else { - $this->_tables[$tableName] =& new DBA_Table($this->_driver); + if (is_string($tableName)) { + if (!isset($this->_tables[$tableName])) { + if (!$this->_manager->tableExists($this->_home.$tableName)) { + return $this->raiseError('DBA: table "'.$tableName. + 'does not exist'); + } else { + $this->_tables[$tableName] =& new DBA_Table($this->_driver); + } } + } else { + return $this->raiseError('DBA: invalid table name, '.$tableName); } if (!$this->_tables[$tableName]->isOpen()) {

« previous php.pear.cvs (#4962) next »