Bug #3056 [Opn->Csd]: "DB Error: syntax error" when editing a bug
| From: | danielc at analysisandsolutions dot com | Date: | Thu, 30 Dec 2004 16:00:48 +0000 |
| Subject: | Bug #3056 [Opn->Csd]: "DB Error: syntax error" when editing a bug | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-3652@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=3056&edit=1
ID: 3056
Updated by: danielc@analysisandsolutions.com
Reported By: kouber at php dot net
-Status: Open
+Status: Closed
Type: Bug
Package: Bug System
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: danielc
New Comment:
Thanks for reporting it and figuring it out. Fixed in CVS.
Previous Comments:
------------------------------------------------------------------------
[2004-12-30 04:04:31] kouber at php dot net
Description:
------------
A "DB Error: syntax error" is thrown when I try to edit a bug and
change the e-mail address (supply an e-mail in the "New email" field).
Without providing information in that field everything works just
fine.
So, I took a look at the source code:
http://cvs.php.net/co.php/pearweb/public_html/bugs/bug.php?r=1.72
and I thing I've found the bug. It is on line 275:
$query .= "email='{$_POST['in']['email']}',";
there have to be a leading space in the string assigned to $query:
$query .= " email='{$_POST['in']['email']}',";
Otherwise, the query becomes "UPDATE bugdb SETemail=...", which is of
course, syntactically incorrect.
Here it is the patch:
275c275
< $query .=
"email='{$_POST['in']['email']}',";
---
> $query .= "
> email='{$_POST['in']['email']}',";
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=3056&edit=1