Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/8177] Display birthdays of 29th february on 28th in non-leap years. #331

Merged
merged 1 commit into from Aug 21, 2011

Conversation

@nickvergessen
Copy link
Contributor

nickvergessen commented Aug 20, 2011

$leap_year_birthdays = '';
if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L'))
{
$leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'";

This comment has been minimized.

Copy link
@bantu

bantu Aug 21, 2011

Member

$db->sql_escape(sprintf('%2d-%2d-', 29, 2)) looks like a constant expression to me.

This comment has been minimized.

Copy link
@bantu

bantu Aug 21, 2011

Member

Well sprintf('%2d-%2d-', 29, 2) is constant and I guess you don't have to call sql_escape() on a known constant.

This comment has been minimized.

Copy link
@bantu

bantu Aug 21, 2011

Member

I take this back, it's okay as is.

// Display birthdays of 29th february on 28th february in non-leap-years
$leap_year_birthdays = '';
if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L'))

This comment has been minimized.

Copy link
@bantu

bantu Aug 21, 2011

Member

Consider using a variable for time() so you pass the same timestamp to phpbb_gmgetdate() and user::format_date()

@bantu bantu merged commit 3c7dfc7 into phpbb:develop-olympus Aug 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.