diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-03-30 01:41:59 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-03-30 01:41:59 +1100 |
| commit | 835d3bfc79f6417a4a468491ffcd5a3ebd7e35f4 (patch) | |
| tree | ba6ee169ffda19d1b6f8ad1afc5d16cf0cc99af7 | |
| parent | 233cb44f18665afa5da73aab1258e711c60eb331 (diff) | |
fully replace SQL wildcard with *
| -rw-r--r-- | mod.php | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -317,7 +317,7 @@ $_body = ''; // Remove SQL wildcard - $phrase = str_replace('%', '%%', $phrase); + $phrase = str_replace('%', '!%', $phrase); // Use asterisk as wildcard to suit convention $phrase = str_replace('*', '%', $phrase); @@ -345,7 +345,7 @@ if(!empty($like)) $like .= ' AND '; $phrase = preg_replace('/^\'(.+)\'$/', '\'%$1%\'', $phrase); - $like .= '`body` LIKE ' . $phrase; + $like .= '`body` LIKE ' . $phrase . ' ESCAPE \'!\''; } $like = str_replace('%', '%%', $like); |
