1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-24 10:53:17 +01:00

Implemented escapeLike() for Oracle driver

This commit is contained in:
Radek Dostál 2011-06-15 06:05:56 -07:00 committed by David Grudl
parent 8c8b3c3dc1
commit 3288b38b6c

View File

@ -267,7 +267,9 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
*/
public function escapeLike($value, $pos)
{
throw new DibiNotImplementedException;
$value = addcslashes(str_replace('\\', '\\\\', $value), "\x00\\%_");
$value = str_replace("'", "''", $value);
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
}