• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BUG/TYPO CI Version 3.1.8

#1
I just updated to CodeIgniter 3.1.8 and directly stumbled on a `typo` within the DB_query_builder.

If you use the following like, you will encounter a error:

PHP Code:
$this->db->like('field''value''BEFORE'); 


This will result in a Database Error like:
syntax error '%'value' ESCAPE '!' ...

The % is placed before the quotes.


Fix:
Edit the DB_query_builder.php file on line 973 from:
PHP Code:
case 'before':                    
$v "%'{$v}'";                
break; 

to:
PHP Code:
case 'before':                    
$v "'%{$v}'";                
break; 


Didn't saw a thread of this yet, in case i missed i'm sorry  Angel
Reply

#2
(04-26-2018, 05:50 AM)nalletje Wrote: I just updated to CodeIgniter 3.1.8 and directly stumbled on a `typo` within the DB_query_builder.

If you use the following like, you will encounter a error:

PHP Code:
$this->db->like('field''value''BEFORE'); 


This will result in a Database Error like:
syntax error '%'value' ESCAPE '!' ...

The % is placed before the quotes.


Fix:
Edit the DB_query_builder.php file on line 973 from:
PHP Code:
case 'before'
$v "%'{$v}'"
break; 

to:
PHP Code:
case 'before'
$v "'%{$v}'"
break; 


Didn't saw a thread of this yet, in case i missed i'm sorry  Angel

On github: https://github.com/bcit-ci/CodeIgniter/issues/5462
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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