From 5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 24 Jun 2007 12:49:13 +0000 Subject: tweak the sql_like_expression feature a little bit to allow correct escaping git-svn-id: file:///svn/phpbb/trunk@7789 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mssql_odbc.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'phpBB/includes/db/mssql_odbc.php') diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 9133f5d0de..290142103f 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -320,19 +320,12 @@ class dbal_mssql_odbc extends dbal } /** - * Correctly adjust LIKE expression for special characters - * MSSQL needs an escape character being defined + * Build LIKE expression + * @access private */ - function sql_like_expression($expression) + function _sql_like_expression($expression) { - // Standard for most DBMS - if (strpos($expression, '_') === false) - { - return 'LIKE \'' . $this->sql_escape($expression) . '\''; - } - - // sql_like_expression is only allowed directly within single quotes (to ease the use of it), therefore the special writing of ESCAPE below - return 'LIKE \'' . $this->sql_escape(str_replace('_', "\_", $expression)) . "' ESCAPE '\\'"; + return $expression . " ESCAPE '\\'"; } /** -- cgit v1.2.1