projects
/
horde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db54bc1
)
avoid malware dates
author
Duck (Jakob Munih)
<duck@obala.net>
Tue, 28 Apr 2009 17:51:56 +0000
(19:51 +0200)
committer
Duck (Jakob Munih)
<duck@obala.net>
Tue, 28 Apr 2009 17:51:56 +0000
(19:51 +0200)
folks/lib/Folks.php
patch
|
blob
|
history
diff --git
a/folks/lib/Folks.php
b/folks/lib/Folks.php
index
5adfbbc
..
fad96af
100644
(file)
--- a/
folks/lib/Folks.php
+++ b/
folks/lib/Folks.php
@@
-117,6
+117,10
@@
class Folks {
*/
static public function calcAge($birthday)
{
+ if (substr($birthday, 0, 4) == '0000') {
+ return array('age' => '', 'sign' => '');
+ }
+
list($year, $month, $day) = explode('-', $birthday);
$year_diff = date('Y') - $year;
$month_diff = date('m') - $month;
@@
-128,7
+132,7
@@
class Folks {
$year_diff--;
}
- if (
$year_diff < 1 || $year == '0000'
) {
+ if (
empty($year_diff)
) {
return array('age' => '', 'sign' => '');
}