diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bace3861..d87dea48b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - Release 2.4.4 🦩 ([belomaxorka](https://github.com/belomaxorka)) - CWE-502 Fixed: Deserialization of untrusted data ([belomaxorka](https://github.com/belomaxorka)) - Create tech stack docs (techstack.yml and techstack.md) [\#1521](https://github.com/torrentpier/torrentpier/pull/1521), [\#1522](https://github.com/torrentpier/torrentpier/pull/1522) ([belomaxorka](https://github.com/belomaxorka)) -- Added integration with MonsterID 🎇 [\#1546](https://github.com/torrentpier/torrentpier/pull/1546) ([belomaxorka](https://github.com/belomaxorka)) +- Added MonsterID avatars support 🎇 [\#1546](https://github.com/torrentpier/torrentpier/pull/1546) ([belomaxorka](https://github.com/belomaxorka)) - Added ability to reset ratio [\#1545](https://github.com/torrentpier/torrentpier/pull/1545) ([belomaxorka](https://github.com/belomaxorka)) - Fixed broken "Disable Board" function [\#1529](https://github.com/torrentpier/torrentpier/pull/1529) ([belomaxorka](https://github.com/belomaxorka)) - Fixed seed bonus accrual [\#1518](https://github.com/torrentpier/torrentpier/pull/1518) ([belomaxorka](https://github.com/belomaxorka)) @@ -22,7 +22,7 @@ - Hide in topic: Added country hiding [\#1535](https://github.com/torrentpier/torrentpier/pull/1535) ([belomaxorka](https://github.com/belomaxorka)) - Hide vote button in topic for guests [\#1507](https://github.com/torrentpier/torrentpier/pull/1507) ([belomaxorka](https://github.com/belomaxorka)) - Word censor code optimization [\#1537](https://github.com/torrentpier/torrentpier/pull/1537) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530), [\#1532](https://github.com/torrentpier/torrentpier/pull/1532), [\#1536](https://github.com/torrentpier/torrentpier/pull/1536), [\#1539](https://github.com/torrentpier/torrentpier/pull/1539), [\#1542](https://github.com/torrentpier/torrentpier/pull/1542), [\#1544](https://github.com/torrentpier/torrentpier/pull/1544) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530), [\#1532](https://github.com/torrentpier/torrentpier/pull/1532), [\#1536](https://github.com/torrentpier/torrentpier/pull/1536), [\#1539](https://github.com/torrentpier/torrentpier/pull/1539), [\#1542](https://github.com/torrentpier/torrentpier/pull/1542), [\#1544](https://github.com/torrentpier/torrentpier/pull/1544), [\#1548](https://github.com/torrentpier/torrentpier/pull/1548) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1504](https://github.com/torrentpier/torrentpier/pull/1504), [\#1513](https://github.com/torrentpier/torrentpier/pull/1513) ([Exileum](https://github.com/Exileum)) ## [v2.4.3](https://github.com/torrentpier/torrentpier/tree/v2.4.3) (2024-06-09) diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index d5b85a939..3a3b3baf8 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -376,22 +376,21 @@ foreach ($profile_fields as $field => $can_edit) { case 'avatar_ext_id': if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar')) { // Integration with MonsterID - if (!isset($_POST['delete_avatar']) && isset($_POST['use_monster_avatar'])) { + if (empty($_FILES['avatar']['name']) && !isset($_POST['delete_avatar']) && isset($_POST['use_monster_avatar'])) { $monsterAvatar = new Arokettu\MonsterID\Monster($pr_data['user_email'], $bb_cfg['avatars']['max_height']); $tempAvatar = tmpfile(); - $tempAvatarMeta = stream_get_meta_data($tempAvatar); + $tempAvatarPath = stream_get_meta_data($tempAvatar)['uri']; $monsterAvatar->writeToStream($tempAvatar); // Manual filling $_FILES['avatar'] $_FILES['avatar'] = array(); - if (!empty($tempAvatarMeta['uri']) && is_file($tempAvatarMeta['uri'])) { + if (is_file($tempAvatarPath)) { $_FILES['avatar'] = [ - 'name' => 'MonsterID.png', - 'full_path' => 'MonsterID.png', - 'type' => 'image/png', - 'tmp_name' => $tempAvatarMeta['uri'], - 'error' => 0, - 'size' => filesize($tempAvatarMeta['uri']) + 'name' => "MonsterID_{$pr_data['user_id']}.png", + 'type' => mime_content_type($tempAvatarPath), + 'tmp_name' => $tempAvatarPath, + 'error' => UPLOAD_ERR_OK, + 'size' => filesize($tempAvatarPath) ]; } } diff --git a/library/includes/ucp/topic_watch.php b/library/includes/ucp/topic_watch.php index 72cf9bfbd..49d01618c 100644 --- a/library/includes/ucp/topic_watch.php +++ b/library/includes/ucp/topic_watch.php @@ -66,7 +66,7 @@ if ($watch_count > 0) { AND p.poster_id = u2.user_id AND t.topic_poster = u.user_id AND w.user_id = $user_id - GROUP BY t.topic_last_post_time DESC + ORDER BY t.topic_last_post_time DESC LIMIT $start, $per_page"; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain watch topic information #3'); diff --git a/library/language/source/main.php b/library/language/source/main.php index 99f72c0ab..f263c67f4 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -607,7 +607,7 @@ $lang['RETURN_PROFILE'] = 'Return to profile'; $lang['SELECT_CATEGORY'] = 'Select category'; $lang['DELETE_IMAGE'] = 'Delete image'; -$lang['SET_MONSTERID_AVATAR'] = 'Set avatar from MonsterID'; +$lang['SET_MONSTERID_AVATAR'] = 'Set MonsterID avatar'; $lang['CURRENT_IMAGE'] = 'Current image'; $lang['NOTIFY_ON_PRIVMSG'] = 'Notify on new private message'; diff --git a/src/Ajax.php b/src/Ajax.php index 6a6109850..22584b8c0 100644 --- a/src/Ajax.php +++ b/src/Ajax.php @@ -254,10 +254,12 @@ class Ajax * @param string $confirm_msg * @throws Exception */ - public function prompt_for_confirm(string $confirm_msg): void + public function prompt_for_confirm(string $confirm_msg = ''): void { + global $lang; + if (empty($confirm_msg)) { - $this->ajax_die('false'); + $confirm_msg = $lang['QUESTION']; } $this->response['prompt_confirm'] = 1;