Skip to content

Commit 84f9f16

Browse files
jan-olivadg
authored andcommitted
Firebird: Add escapeLike() (#300)
1 parent c8dfb1f commit 84f9f16

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Dibi/Drivers/FirebirdDriver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ public function escapeDateTime($value): string
276276
*/
277277
public function escapeLike(string $value, int $pos): string
278278
{
279-
throw new Dibi\NotImplementedException;
279+
$value = addcslashes(str_replace('\\', '\\\\', $value), "\x00\n\r\\'%_");
280+
return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'");
280281
}
281282

282283

0 commit comments

Comments
 (0)