From: anuko Date: Tue, 25 Jul 2017 22:43:30 +0000 (+0000) Subject: Initial implementation of a condition on notifications. X-Git-Tag: timetracker_1.19-1~1507 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4af7dd7e10968588fe4c2828be5402f41d53ebc5;p=timetracker.git Initial implementation of a condition on notifications. --- diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 81c870f8..ac0b6825 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -308,6 +308,23 @@ function ttValidCronSpec($val) return true; } +// ttValidCondition is used to check user input to validate a notification condition. +function ttValidCondition($val, $emptyValid = true) +{ + $val = trim($val); + if (strlen($val) == 0) + return ($emptyValid ? true : false); + + // String must not be XSS evil (to insert JavaScript). + if (stristr($val, '