Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.2 #305

Closed
wants to merge 2 commits into from
Closed

V3.2 #305

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Dibi/Drivers/FirebirdDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ public function escapeDateTime($value)
*/
public function escapeLike($value, $pos)
{
throw new Dibi\NotImplementedException;
$value = addcslashes(str_replace('\\', '\\\\', $value), "\x00\n\r\\'%_");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myslím že Firebird neescapuje lomítka. Tohle je fakt ožehavá operace a nemůžeš kopírovat kód od jinud pokud si nejsi 1000% jistý, co dělá…

Copy link
Owner

@dg dg Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Možná by mohlo fungovat tohle z SQLite:

		$value = addcslashes($this->escapeText($value), '%_\\');
		return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'") . " ESCAPE '\\'";

Ale nemám možnost jak to ověřit, a pokud neoveříš, že to skutečně funguje jak má, tak se mi to moc nechce mergovat…

return ($pos <= 0 ? "'%" : "'") . $value . ($pos >= 0 ? "%'" : "'") .' ESCAPE '. "'\'";
}


Expand Down