From 47c1c66558c915725e8f5576ab0cd3b7c293cfff Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 3 Jul 2025 11:30:49 +0300 Subject: [PATCH] fix: handle Nette DateTime objects in birthday validation --- library/includes/ucp/viewprofile.php | 2 ++ viewtopic.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php index 3d4605e68..e9f8903a7 100644 --- a/library/includes/ucp/viewprofile.php +++ b/library/includes/ucp/viewprofile.php @@ -30,6 +30,8 @@ if (!$profiledata = get_userdata($_GET[POST_USERS_URL], profile_view: true)) { bb_die($lang['NO_USER_ID_SPECIFIED']); } +$profiledata['user_birthday'] = $profiledata['user_birthday']->format('Y-m-d'); + if (!$ranks = $datastore->get('ranks')) { $datastore->update('ranks'); $ranks = $datastore->get('ranks'); diff --git a/viewtopic.php b/viewtopic.php index 806327ded..6e7a2b9d2 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -565,6 +565,7 @@ for ($i = 0; $i < $total_posts; $i++) { $poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? $postrow[$i]['user_from'] : ''; $poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : ''; $poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : ''; + $poster_birthday = $postrow[$i]['user_birthday']->format('Y-m-d'); $post_id = $postrow[$i]['post_id']; $mc_type = (int)$postrow[$i]['mc_type']; $mc_comment = $postrow[$i]['mc_comment']; @@ -715,7 +716,7 @@ for ($i = 0; $i < $total_posts; $i++) { 'DELETE' => $delpost_btn, 'IP' => $ip_btn, - 'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']), + 'POSTER_BIRTHDAY' => user_birthday_icon($poster_birthday, $postrow[$i]['user_id']), 'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '', 'MC_BBCODE' => $mc_type ? $mc_comment : '',