aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 694f173268..43aca88ade 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1072,7 +1072,18 @@ while ($row = $db->sql_fetchrow($result))
if ($bday_year)
{
- $user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - (($today['month'] - $bday_month < 0) ? 1 : (($today['day'] - $bday_day < 0) ? 1 : 0)));
+ $diff = $today['month'] - $bday_month;
+ if ($diff == 0)
+ {
+ $diff = ($today['day'] - $bday_day < 0) ? 1 : 0;
+ }
+ else
+ {
+ $diff = ($diff < 0) ? 1 : 0;
+ }
+
+ $age = (int) (date('Y', $time) - $bday_year - $diff);
+ $user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
}
}
}