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); } diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index ec245795ad..1b6cb5ef94 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1699,7 +1699,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f $diff = ($diff < 0) ? 1 : 0; } - $age = (int) ($now['year'] - $bday_year - $diff); + $age = max(0, (int) ($now['year'] - $bday_year - $diff)); } } diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 74f563f17d..f254ed1463 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -28,7 +28,7 @@