aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mssql.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-06-24 12:49:13 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-06-24 12:49:13 +0000
commit5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274 (patch)
tree63f64d470a44ff71aa4ef83775e3e0727dd76e46 /phpBB/includes/db/mssql.php
parent318418b0f266998895f88e9fcbcd3873a518c4b5 (diff)
downloadforums-5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274.tar
forums-5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274.tar.gz
forums-5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274.tar.bz2
forums-5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274.tar.xz
forums-5aa220bcd21c6e3decd8f2b9833dc90a8ee6a274.zip
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
Diffstat (limited to 'phpBB/includes/db/mssql.php')
-rw-r--r--phpBB/includes/db/mssql.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index ba8e8681ec..422a5d44a4 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -309,19 +309,12 @@ class dbal_mssql 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 '\\'";
}
/**