projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed adding subgroups with a proper parent group.
[timetracker.git]
/
WEB-INF
/
lib
/
common.lib.php
diff --git
a/WEB-INF/lib/common.lib.php
b/WEB-INF/lib/common.lib.php
index
d1ad384
..
4411fb5
100644
(file)
--- a/
WEB-INF/lib/common.lib.php
+++ b/
WEB-INF/lib/common.lib.php
@@
-165,7
+165,7
@@
function check_extension($ext)
// isTrue is a helper function to return correct false for older config.php values defined as a string 'false'.
function isTrue($val)
{
// isTrue is a helper function to return correct false for older config.php values defined as a string 'false'.
function isTrue($val)
{
- return ($val ==
false || $val === 'false') ? false : true
;
+ return ($val ==
= true)
;
}
// ttValidString is used to check user input to validate a string.
}
// ttValidString is used to check user input to validate a string.
@@
-319,7
+319,7
@@
function ttValidCondition($val, $emptyValid = true)
if (stristr($val, '<script>') || stristr($val, '<script '))
return false;
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;
return true;
@@
-390,3
+390,11
@@
function ttStartsWith($string, $startString)
$len = strlen($startString);
return (substr($string, 0, $len) === $startString);
}
$len = strlen($startString);
return (substr($string, 0, $len) === $startString);
}
+
+// ttDateToUserFormat converts a date from database format to user format.
+function ttDateToUserFormat($date)
+{
+ global $user;
+ $o_date = new DateAndTime(DB_DATEFORMAT, $date);
+ return $o_date->toString($user->date_format);
+}