From a072526890a5ebbe363f57f31f9c516a9a416883 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 8 May 2011 21:31:19 +0200 Subject: [PATCH] [ticket/10173] Only calculate age if year is not false as per nn-. PHPBB3-10173 --- phpBB/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/index.php b/phpBB/index.php index 62c229f0b5..5d62cb1071 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -98,15 +98,15 @@ 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 = $now['year'] - $birthday_year; + $birthday_age = ($birthday_year) ? $now['year'] - $birthday_year : ''; $template->assign_block_vars('birthdays', array( 'USERNAME' => $birthday_username, - 'AGE' => ($birthday_year) ? $birthday_age : '', + 'AGE' => $birthday_age, )); // For 3.0 compatibility - $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : ''); + $birthday_list[] = $birthday_username . (($birthday_age) ? ' (' . $birthday_age . ')' : ''); } $db->sql_freeresult($result); }