Index: index.php =================================================================== --- index.php (Revision 9422) +++ index.php (Arbeitskopie) @@ -84,10 +84,17 @@ if ($config['load_birthdays'] && $config['allow_birthdays']) { $now = getdate(time() + $user->timezone + $user->dst - date('Z')); + // Display birthdays of 29th february on 28th february in non-leap-years + $leap_year_birthdays = ''; + if (($now['mday'] == 28) && ($now['mon'] == 2) && !(($now['year'] % 400) == 0 || (($now['year'] % 4) == 0 && ($now['year'] % 100) != 0))) + { + $leap_year_birthdays = "user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; + } $sql = 'SELECT user_id, username, user_colour, user_birthday FROM ' . USERS_TABLE . " WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' - AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + " . (($leap_year_birthdays) ? " AND $leap_year_birthdays " : '') . ' + AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result))