Fix phpcs
This commit is contained in:
parent
40bc26a666
commit
53a1867be8
@ -188,7 +188,7 @@ class FormProjets
|
|||||||
$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
|
$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
|
||||||
}
|
}
|
||||||
if ($morefilter) {
|
if ($morefilter) {
|
||||||
$sql .= ' AND ('.$morefilter.')';
|
$sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')';
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY p.ref ASC";
|
$sql .= " ORDER BY p.ref ASC";
|
||||||
|
|
||||||
|
|||||||
@ -136,15 +136,12 @@ abstract class DoliDB implements Database
|
|||||||
*
|
*
|
||||||
* @param string $stringtosanitize String to escape
|
* @param string $stringtosanitize String to escape
|
||||||
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
|
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
|
||||||
|
* @param string $allowsequals 1=Allow equals sign
|
||||||
* @return string String escaped
|
* @return string String escaped
|
||||||
*/
|
*/
|
||||||
public function sanitize($stringtosanitize, $allowsimplequote = 0)
|
public function sanitize($stringtosanitize, $allowsimplequote = 0, $allowsequals = 0)
|
||||||
{
|
{
|
||||||
if ($allowsimplequote) {
|
return preg_replace('/[^a-z0-9_\-\.,'.($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').']/i', '', $stringtosanitize);
|
||||||
return preg_replace('/[^a-z0-9_\-\.,\']/i', '', $stringtosanitize);
|
|
||||||
} else {
|
|
||||||
return preg_replace('/[^a-z0-9_\-\.,]/i', '', $stringtosanitize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user