if (stristr($val, '<script>') || stristr($val, '<script '))
return false;
- if (!preg_match("/^count\s?>\s?\d+$/", $val))
+ if (!preg_match("/^count\s?(=|[<>]=?)\s?\d+$/", $val))
return false;
return true;
return false;
}
+
+// ttStartsWith functions checks if a string starts with a given substring.
+function ttStartsWith($string, $startString)
+{
+ $len = strlen($startString);
+ return (substr($string, 0, $len) === $startString);
+}
{
$items = ttReportHelper::getItems($options);
- $condition = str_replace('count', '', $condition);
- $count_required = (int) trim(str_replace('>', '', $condition));
+ $condition = trim(str_replace('count', '', $condition));
- if (count($items) > $count_required)
- return true; // Condition ok.
+ $greater_or_equal = ttStartsWith($condition, '>=');
+ if ($greater_or_equal) $condition = trim(str_replace('>=', '', $condition));
+
+ $greater = ttStartsWith($condition, '>');
+ if ($greater) $condition = trim(str_replace('>', '', $condition));
+
+ $less_or_equal = ttStartsWith($condition, '<=');
+ if ($less_or_equal) $condition = trim(str_replace('<=', '', $condition));
+
+ $less = ttStartsWith($condition, '<');
+ if ($less) $condition = trim(str_replace('<', '', $condition));
+
+ $equal = ttStartsWith($condition, '=');
+ if ($equal) $condition = trim(str_replace('=', '', $condition));
+
+ $count_required = (int) $condition;
+
+ if ($greater && count($items) > $count_required) return true;
+ if ($greater_or_equal && count($items) >= $count_required) return true;
+ if ($less && count($items) < $count_required) return true;
+ if ($less_or_equal && count($items) <= $count_required) return true;
+ if ($equal && count($items) == $count_required) return true;
return false;
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.99.4322 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.100.4323 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>