From: Duck (Jakob Munih) Date: Tue, 28 Apr 2009 17:51:56 +0000 (+0200) Subject: avoid malware dates X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7e3a86aab84b5de022ccc075efbb7e5a544c4dfc;p=horde.git avoid malware dates --- diff --git a/folks/lib/Folks.php b/folks/lib/Folks.php index 5adfbbccb..fad96af0e 100644 --- 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' => ''); }