diff --git a/dibi/drivers/DibiPostgreDriver.php b/dibi/drivers/DibiPostgreDriver.php index d973c0d0..caf8602e 100644 --- a/dibi/drivers/DibiPostgreDriver.php +++ b/dibi/drivers/DibiPostgreDriver.php @@ -300,8 +300,9 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr */ public function escapeLike($value, $pos) { + $bs = pg_escape_string($this->connection, '\\'); // standard_conforming_strings = on/off $value = pg_escape_string($this->connection, $value); - $value = strtr($value, array( '%' => '\\\\%', '_' => '\\\\_')); + $value = strtr($value, array('%' => $bs . '%', '_' => $bs . '_', '\\' => '\\\\')); return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'"); }