Skip to content
Snippets Groups Projects
Commit ef3a37b4 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Fix field value comparisons

parent 69ab6b90
No related merge requests found
......@@ -128,31 +128,31 @@ abstract class StringComparisonBase extends ConditionBase implements OptionsInte
break;
case static::COMPARE_BEGINS_WITH:
$result = mb_strpos($value1, $value2) === 0;
$result = mb_strpos($value2, $value1) === 0;
break;
case static::COMPARE_ENDS_WITH:
$result = mb_strpos($value1, $value2) === (mb_strlen($value1) - mb_strlen($value2));
$result = mb_strpos($value2, $value1) === (mb_strlen($value2) - mb_strlen($value1));
break;
case static::COMPARE_CONTAINS:
$result = mb_strpos($value1, $value2) !== FALSE;
$result = mb_strpos($value2, $value1) !== FALSE;
break;
case static::COMPARE_GREATERTHAN:
$result = $value1 > $value2;
$result = $value2 > $value1;
break;
case static::COMPARE_LESSTHAN:
$result = $value1 < $value2;
$result = $value2 < $value1;
break;
case static::COMPARE_ATMOST:
$result = $value1 <= $value2;
$result = $value2 <= $value1;
break;
case static::COMPARE_ATLEAST:
$result = $value1 >= $value2;
$result = $value2 >= $value1;
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment