mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-05 12:36:12 -07:00
fix: handle Nette DateTime objects in birthday validation (#2032)
* fix: handle Nette DateTime objects in birthday validation * Update register.php * Update User.php
This commit is contained in:
parent
423fb65dbf
commit
6e7e3dd9ef
4 changed files with 6 additions and 1 deletions
|
@ -142,6 +142,7 @@ switch ($mode) {
|
|||
if (!$pr_data = DB()->fetch_row($sql)) {
|
||||
bb_die($lang['PROFILE_NOT_FOUND']);
|
||||
}
|
||||
$pr_data['user_birthday'] = $pr_data['user_birthday']->format('Y-m-d');
|
||||
if (IN_DEMO_MODE && isset($_COOKIE['user_lang'])) {
|
||||
$pr_data['user_lang'] = $_COOKIE['user_lang'];
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -232,6 +232,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
$this->data['user_birthday'] = $this->data['user_birthday']->format('Y-m-d');
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 : '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue