#108 [NEW]: MDB 1.x getValue run in "Document contains no Data"

From: Date: Wed, 15 Oct 2003 22:10:32 +0000
Subject: #108 [NEW]: MDB 1.x getValue run in "Document contains no Data"
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22714@lists.php.net to get a copy of this message
From: ths at 4bconsult dot de Operating system: WinXP PHP version: 4.3.3 PHP Bug Type: MDB Bug description: MDB 1.x getValue run in "Document contains no Data" Description: ------------ When calling getValue with an empty $type, this produce an recursive call of getValue with an empty $type... Would be better to have an error message like in the appended patch or extend the condition: if (!empty($type) and method_exists($this,"get{$type}Value")) { Index: Common.php =================================================================== RCS file: /repository/pear/MDB/MDB/Common.php,v retrieving revision 1.114.4.1 diff -u -r1.114.4.1 Common.php --- Common.php 18 Sep 2003 17:32:17 -0000 1.114.4.1 +++ Common.php 15 Oct 2003 21:57:59 -0000 @@ -3472,6 +3472,10 @@ */ function getValue($type, $value) { + if (empty($type)) { + return($this->raiseError(MDB_ERROR_SYNTAX, NULL, NULL, + 'getValue() called without type to convert to')); + } if (method_exists($this,"get{$type}Value")) { return $this->{"get{$type}Value"}($value); } -- Edit bug report at http://pear.php.net/bugs/bug.php?id=108&edit=1 --

« previous php.pear.dev (#22714) next »