From 36b0c949fdb16163e4b57b1db0cbc777941eff6f Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Sat, 2 Apr 2011 12:16:41 +0100
Subject: Fixed issue #153 Escape Str Bug in MSSQL driver
---
system/database/drivers/mssql/mssql_driver.php | 8 +++++---
user_guide/changelog.html | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index b581a478c..65397ed8f 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -267,9 +267,11 @@ class CI_DB_mssql_driver extends CI_DB {
// escape LIKE condition wildcards
if ($like === TRUE)
{
- $str = str_replace( array('%', $this->_like_escape_chr, '_'),
- array($this->_like_escape_chr.'%', $this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'_'),
- $str);
+ $str = str_replace(
+ array($this->_like_escape_chr, '%', '_'),
+ array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'),
+ $str
+ );
}
return $str;
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index bf86172d7..b1900301a 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -84,6 +84,7 @@ Hg Tag: n/a
Fixed a bug (Reactor #80) where is_really_writable would create an empty file when on Windows or with safe_mode enabled.
Fixed various bugs with User Guide.
Added form_validation_lang entries for decimal, less_than and greater_than.
+ Fixed issue #153 Escape Str Bug in MSSQL driver.
Version 2.0.1
--
cgit v1.2.3-24-g4f1b