Welcome Guest, Not a member yet? Register   Sign In
DB prefix is placed in the wrong place when using MySQL function in SELECT clause
#2

[eluser]mattalexx[/eluser]
Here's my hack (I'll extend the db class for this later, but right now, I'm hacking the core). Before:
Code:
// ci/database/DB_driver.php, line 1240:
if ($this->dbprefix != '')
Code:
if ($this->dbprefix != '' && preg_match('/^[a-z!]+\(/i', $parts[0]) !== 1)
Now, everything works if I use CI_DB_active_record::dbprefix() to escape everything.

EDIT: I put a shriek in the regex so that "!ISNULL(..." is supported as well as "ISNULL(...".


Messages In This Thread
DB prefix is placed in the wrong place when using MySQL function in SELECT clause - by El Forum - 12-12-2008, 01:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB