Welcome Guest, Not a member yet? Register   Sign In
BE AWARE: multiple spaces or tabs problem in plain SQL
#1

[eluser]joergy[/eluser]
Hi folks,
having two spaces in a password gives me a headacheā€¦
The reason: if you don't pass an array but a sql-expression to $this->db->where() the whole statement is taken as a 'key' (and not a 'value'). DB_active_rec::_where() calls _protect_identifiers() on that 'key' which throws out multiple '\t' and spaces, replacing them by one.
So my password failedā€¦

I suppose it's a good idea to be very careful when using own sql-statements.
There are additional issues concerning backticks in plain sql-statements.

joergy
#2

[eluser]jcjc[/eluser]
Couldn't you just validate your inputs beforehand and avoid this completely?




Theme © iAndrew 2016 - Forum software by © MyBB