• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.