Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend
In directory usw-pr-cvs1:/tmp/cvs-serv7137/lib/WikiDB/backend
Modified Files:
PearDB.php
Log Message:
Fix quoting of search expressions. (Searches for words containing
'%', '\', or '_' were broken prior to this fix.)
Index: PearDB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** PearDB.php 2001/10/29 17:57:24 1.7
--- PearDB.php 2001/11/07 21:12:47 1.8
***************
*** 458,461 ****
--- 458,462 ----
function _sql_match_clause($word) {
+ $word = preg_replace('/(?=[%_\\\\])/', "\\", $word);
$word = $this->_dbh->quoteString($word);
return "LOWER(pagename) LIKE '%$word%'";
***************
*** 463,466 ****
--- 464,468 ----
function _fullsearch_sql_match_clause($word) {
+ $word = preg_replace('/(?=[%_\\\\])/', "\\", $word);
$word = $this->_dbh->quoteString($word);
return "LOWER(pagename) LIKE '%$word%' OR content LIKE '%$word%'";
|