* Search :
- Nickname are used in fast search. -Car
+Fixes (from 0.9.6 branch) :
+
+ * Search :
+ - #307: fix bad escaping in advanced search. -MC
+
================================================================================
VERSION 0.9.6 07 May 2004
function compare()
{
- return $this->exact ? "='{$this->value}'" : " LIKE '%{$this->value}%'";
+ $val = addslashes($this->value);
+ return $this->exact ? "='$val}'" : " LIKE '%$val%'";
}
// }}}
* @param field nom de champ de la bdd concerné par la clause */
function get_single_where_statement($field)
{
- $regexp = strtr($this->value, '-*', '_%');
+ $regexp = strtr(addslashes($this->value), '-*', '_%');
return "$field LIKE '$regexp%'";
}
function get_order_statement()
{
if ($this->value!='' && $this->fieldResultName!='') {
- return "{$this->fieldResultName}!='{$this->value}'";
+ return "{$this->fieldResultName}!='".addslashes($this->value)."'";
} else {
return false;
}
function get_single_where_statement($field)
{
- $regexp = strtr($this->value, '-*', '_%');
+ $regexp = strtr(addslashes($this->value), '-*', '_%');
return "$field LIKE '$regexp%' OR $field LIKE '% $regexp%' OR $field LIKE '%-$regexp%'";
}
function get_order_statement()
{
if ($this->value!='' && $this->fieldResultName!='') {
- return "{$this->fieldResultName} NOT LIKE '{$this->value}'";
+ return "{$this->fieldResultName} NOT LIKE '".addslashes($this->value)."'";
} else {
return false;
}