Skip to content

Commit

Permalink
Don't remove space if it's like,notlike,contains operation
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jan 13, 2022
1 parent 0df4bbf commit 58df43e
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -100,9 +100,11 @@ public static function process($chat, $action, $trigger, $params)
$attr = str_replace(array_keys($replaceArray), array_values($replaceArray),$attr);
$valAttr = str_replace(array_keys($replaceArray), array_values($replaceArray),$valAttr);

// Remove spaces
$attr = preg_replace('/\s+/', '', $attr);
$valAttr = preg_replace('/\s+/', '', $valAttr);
if (!in_array($condition['content']['comp'],['like','notlike','contains'])) {
// Remove spaces only if it's not like operator
$attr = preg_replace('/\s+/', '', $attr);
$valAttr = preg_replace('/\s+/', '', $valAttr);
}

// Allow only mathematical operators
$conditionAttrMath = preg_replace("/[^\(\)\.\*\-\/\+0-9]+/", "", $attr);
Expand Down

0 comments on commit 58df43e

Please sign in to comment.