diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-10-20 13:21:09 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-10-20 13:21:09 +0200 |
commit | 8ba1abbfb4a89bc4562b91551300ab36b56d4897 (patch) | |
tree | 3dddfa2ac33dfecadea9a9f80d40c2f27eb28e76 | |
parent | b00bdf5204088a29691b0428a14dd2e0ccf7bbcd (diff) | |
download | nextcloud-server-8ba1abbfb4a89bc4562b91551300ab36b56d4897.tar.gz nextcloud-server-8ba1abbfb4a89bc4562b91551300ab36b56d4897.zip |
Adding escapeLikeParameter to \DB\Connection
-rw-r--r-- | lib/private/db/connection.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index 4d33cd968af..1b86d3d383a 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -301,4 +301,14 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { public function inTransaction() { return $this->getTransactionNestingLevel() > 0; } + + /** + * Espace a parameter to be used in a LIKE query + * + * @param string $param + * @return string + */ + public function escapeLikeParameter($param) { + return addcslashes($param, '\\_%'); + } } |