Skip to content

Commit

Permalink
Firebird: Add escapeLike() (#300,#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-oliva authored and dg committed Sep 17, 2018
1 parent eaf2494 commit fe0e751
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dibi/Drivers/FirebirdDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ public function escapeDateTime($value): string
*/
public function escapeLike(string $value, int $pos): string
{
throw new Dibi\NotImplementedException;
$value = addcslashes($this->escapeText($value), '%_\\');
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'") . " ESCAPE '\\'";
}


Expand Down

0 comments on commit fe0e751

Please sign in to comment.