aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 419b66cfdb..63361c43c7 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -98,7 +98,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$birthday_year = (int) substr($row['user_birthday'], -4);
- $birthday_age = ($birthday_year) ? $now['year'] - $birthday_year : '';
+ $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
$template->assign_block_vars('birthdays', array(
'USERNAME' => $birthday_username,
@@ -106,7 +106,10 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
));
// For 3.0 compatibility
- $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ if ($age = (int) substr($row['user_birthday'], -4))
+ {
+ $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ }
}
$db->sql_freeresult($result);
}