#108 [Ver->Csd]: MDB 1.x getValue run in "Document contains no Data"
| From: | lsmith@php.net | Date: | Thu, 16 Oct 2003 15:05:44 +0000 |
| Subject: | #108 [Ver->Csd]: MDB 1.x getValue run in "Document contains no Data" | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22729@lists.php.net to get a copy of this message | ||
ID: 108
Updated by: lsmith@php.net
Reported By: ths at 4bconsult dot de
-Status: Verified
+Status: Closed
Bug Type: MDB
Operating System: WinXP
PHP Version: 4.3.3
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of the package, which you can download
at
http://pear.php.net/packages.php
Previous Comments:
------------------------------------------------------------------------
[2003-10-15 18:20:35] lsmith@php.net
yup .. nicely spotted, thx for the patch ..
I am about to make a new release soon.
------------------------------------------------------------------------
[2003-10-15 18:10:32] ths at 4bconsult dot de
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 this bug report at http://pear.php.net/bugs/bug.php?id=108&edit=1