Skip to content

Commit

Permalink
Firebird: Add escapeLike() (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-oliva authored and dg committed Jul 14, 2018
1 parent c8dfb1f commit 84f9f16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dibi/Drivers/FirebirdDriver.php
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(str_replace('\\', '\\\\', $value), "\x00\n\r\\'%_");
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
}


Expand Down

0 comments on commit 84f9f16

Please sign in to comment.