Bug #3056 [NEW]: "DB Error: syntax error" when editing a bug
| From: | kouber at php dot net | Date: | Thu, 30 Dec 2004 09:04:31 +0000 |
| Subject: | Bug #3056 [NEW]: "DB Error: syntax error" when editing a bug | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-3650@lists.php.net to get a copy of this message | ||
From: kouber at php dot net
Operating system: Irrelevant
PHP version: Irrelevant
Package: Bug System
Bug Type: Bug
Bug description: "DB Error: syntax error" when editing a bug
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 bug report at http://pear.php.net/bugs/bug.php?id=3056&edit=1
--