* @param string $input, the provided value
* @return string the escaped string
*/
- public function escapeFilterPart($input) {
+ public function escapeFilterPart($input, $allowAsterisk = false) {
+ $asterisk = '';
+ if($allowAsterisk && strlen($input) > 0 && $input[0] === '*') {
+ $asterisk = '*';
+ $input = mb_substr($input, 1, null, 'UTF-8');
+ }
$search = array('*', '\\', '(', ')');
$replace = array('\\*', '\\\\', '\\(', '\\)');
- return str_replace($search, $replace, $input);
+ return $asterisk . str_replace($search, $replace, $input);
}
/**
* Get a list of all users.
*/
public function getUsers($search = '', $limit = 10, $offset = 0) {
- $search = $this->access->escapeFilterPart($search);
+ $search = $this->access->escapeFilterPart($search, true);
$cachekey = 'getUsers-'.$search.'-'.$limit.'-'.$offset;
//check if users are cached, if so return