You are here

function rules_condition_text_compare in Rules 6

Condition Implementation: Textual comparison.

Related topics

1 string reference to 'rules_condition_text_compare'
workflow_ng_condition_token_compare_upgrade in rules/modules/rules.rules_forms.inc
The following functions help converting actions when upgrading from workflow-ng

File

rules/modules/rules.rules.inc, line 172
rules integration for the rules module

Code

function rules_condition_text_compare($text1, $text2, $settings) {
  if ($settings['regex']) {
    return (bool) preg_match('/' . str_replace('/', '\\/', $text2) . '/', $text1);
  }
  return $text1 == $text2;
}