![]() |
CI 2.1.4 oci8 driver escape_str() double-escapes - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: CI 2.1.4 oci8 driver escape_str() double-escapes (/showthread.php?tid=60611) |
CI 2.1.4 oci8 driver escape_str() double-escapes - El Forum - 05-09-2014 [eluser]Unknown[/eluser] This is a bug in CodeIgniter 2.1.4. - /database/drivers/oci8/oci8_driver.php Observed effect: When escaping a string in a like clause, the escape character is added twice to the string. EG: input string 'ALTS2_02' - output string 'ALTS2!!_02' - expected string 'ALTS2!_02' Cause: str_replace() replace order. The function replaces _ with !_ , then replaces ! with !!. Fix: change the order so that the escape character is searched for first. Fix: line 794 - 796 Original code: Code: $str = str_replace( Fixed code: Code: $str = str_replace( |