Menu

#2 Error when user name contains a whitespace character

open
nobody
None
5
2004-12-16
2004-12-16
No

I created a user with login name 'hermansr' and user
name 'Roland Hermans'. After restarting the webbrowser
the following error is written to ./tmp/pptsLog.txt
when I try to open the main PPTS page.

12-16, 22:47 hermansr : Query: SELECT * FROM users
WHERE id = Roland Hermans Error: You have an error in
your SQL syntax near 'Hermans' at line 1

The error is reported when trying to run the SQL
statement constructed on line 40 of
common/classes/CElement.php:

$sql = "SELECT * FROM $this->tableName WHERE id = $id";

By surrounding $id with single quotes the problem
_appeared_ to be solved, but I don't know whether user
names with space characters should be supported at all.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB