From: <tr...@us...> - 2002-09-11 09:02:52
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv11389 Modified Files: user.inc.php search.inc.php Log Message: Replaced LIKE with db_oper_like() Index: user.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/user.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** user.inc.php 10 Sep 2002 23:06:35 -0000 1.10 --- user.inc.php 11 Sep 2002 09:02:50 -0000 1.11 *************** *** 328,332 **** "WHERE userName = '".addslashes($name)."'", "SELECT id, `userName` FROM Submitter ". ! "WHERE name LIKE '".addslashes($name)."%' ".db_limit(0, 1)); for($i = 0; $i < count($qarr); $i++) { --- 328,333 ---- "WHERE userName = '".addslashes($name)."'", "SELECT id, `userName` FROM Submitter ". ! "WHERE name ".db_oper_like()." '".addslashes($name)."%' ". ! db_limit(0, 1)); for($i = 0; $i < count($qarr); $i++) { Index: search.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/search.inc.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** search.inc.php 10 Sep 2002 23:06:30 -0000 1.39 --- search.inc.php 11 Sep 2002 09:02:50 -0000 1.40 *************** *** 677,681 **** if(is_string($arr[0])) { ! if($op == 2) $opname = "LIKE"; else $opname = $ops[$op]; $where .= " AND $fname $opname '".addslashes($arr[0])."'"; --- 677,682 ---- if(is_string($arr[0])) { ! if($op == 2) ! $opname = db_oper_like(); else $opname = $ops[$op]; $where .= " AND $fname $opname '".addslashes($arr[0])."'"; *************** *** 695,699 **** { for($j = 0; $j < count($arr); $j++) ! $arr[$j] = "$fname LIKE '".addslashes($arr[$j])."'"; $n = $op == 7 ? "" : "NOT "; $where .= " AND $n(".implode(" OR ", $arr).")"; --- 696,703 ---- { for($j = 0; $j < count($arr); $j++) ! { ! $arr[$j] = "$fname ".db_oper_like(). ! " '".addslashes($arr[$j])."'"; ! } $n = $op == 7 ? "" : "NOT "; $where .= " AND $n(".implode(" OR ", $arr).")"; |