Skip to content

Commit

Permalink
Release 2.1.3 (#3575)
Browse files Browse the repository at this point in the history
* fix: purify custom field values before display

* fix: empty reset code is usable

* release: 2.1.3
  • Loading branch information
samerton authored Jan 8, 2025
1 parent ca92628 commit c3e7fce
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ body:
description: From StaffCP -> Overview
options:
- Development version
- 2.1.0
- < 2.1.0
- 2.1.3
- <= 2.1.2
validations:
required: true

Expand Down
10 changes: 5 additions & 5 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The following NamelessMC releases are supported by the development team

| Version | Supported |
|-----------|--------------------|
| 2.1.x | :white_check_mark: |
| <= 2.0.3 | :x: |
| 2.1.3 | :white_check_mark: |
| <= 2.1.2 | :x: |
| <= 1.0.22 | :x: |

## Reporting a Vulnerability

Currently, the best place to report a vulnerability is either via email or Discord.
Currently, the best place to report a vulnerability is on GitHub.

- huntr.dev - https://huntr.dev/repos/namelessmc/nameless
- Discord server: https://discord.gg/nameless -> Samerton#9433
- GitHub - https://github.com/NamelessMC/Nameless/security/advisories/new
- Discord server: https://discord.gg/nameless -> Samerton
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# NamelessMC v2 Changelog

## [Unreleased](https://github.com/NamelessMC/Nameless/compare/v2.1.2...develop)
## [Unreleased](https://github.com/NamelessMC/Nameless/compare/v2.1.3...develop)
> [Milestone](https://github.com/NamelessMC/Nameless/milestone/22)
## [2.1.3](https://github.com/NamelessMC/Nameless/compare/v2.1.2...v2.1.3) - 2025-01-08
### Added
- No additions this release

### Changed
- No changes this release

### Fixed
- Purify custom fields before display
- Fix empty reset code being usable

## [2.1.2](https://github.com/NamelessMC/Nameless/compare/v2.1.1...v2.1.2) - 2023-09-30
### Added
- No additions this release
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2014-2023 NamelessMC Contributors
Copyright © 2014-2025 NamelessMC Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 6 additions & 1 deletion core/classes/DTO/UserProfileField.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package NamelessMC\DTO
* @author Aberdeener
* @version 2.0.0-pr13
* @version 2.1.3
* @license MIT
*/
class UserProfileField extends ProfileField {
Expand All @@ -20,6 +20,11 @@ public function __construct(object $row) {
$this->upf_id = $row->upf_id;
}

public function purifyValue(): ?string
{
// TODO: option for field to support HTML
return Output::getClean($this->value);
}

public function updated() {
return date(DATE_FORMAT, $this->updated);
Expand Down
2 changes: 1 addition & 1 deletion core/classes/Database/DatabaseInitialiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private function initialiseSettings(): void {
Util::setSetting('recaptcha_type', 'Recaptcha3');
Util::setSetting('recaptcha_login', '0');
Util::setSetting('email_verification', '1');
Util::setSetting('nameless_version', '2.1.2');
Util::setSetting('nameless_version', '2.1.3');
Util::setSetting('version_checked', date('U'));
Util::setSetting('phpmailer', '0');
Util::setSetting('user_avatars', '0');
Expand Down
8 changes: 8 additions & 0 deletions core/includes/updates/212.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
return new class extends UpgradeScript {
public function run(): void {
$this->runMigrations();

$this->setVersion('2.1.3');
}
};
2 changes: 1 addition & 1 deletion custom/panel_templates/Default/core/user.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
</td>
<td>
{if $USER_PROFILE_FIELDS[$field->id]->value}
{$USER_PROFILE_FIELDS[$field->id]->value}
{$USER_PROFILE_FIELDS[$field->id]->purifyValue()}
{else}
<i>{$NOT_SET}</i>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions custom/panel_templates/Default/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function __construct(Smarty $smarty, Language $language) {

parent::__construct(
'Default', // Template name
'2.1.2', // Template version
'2.1.2', // Nameless version template is made for
'2.1.3', // Template version
'2.1.3', // Nameless version template is made for
'<a href="https://coldfiredzn.com" target="_blank">Coldfire</a>' // Author, you can use HTML here
);

Expand Down
4 changes: 2 additions & 2 deletions custom/templates/DefaultRevamp/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class DefaultRevamp_Template extends TemplateBase {
public function __construct($cache, $smarty, $language, $user, $pages) {
$template = [
'name' => 'DefaultRevamp',
'version' => '2.1.2',
'nl_version' => '2.1.2',
'version' => '2.1.3',
'nl_version' => '2.1.3',
'author' => '<a href="https://xemah.com/" target="_blank">Xemah</a>',
];

Expand Down
4 changes: 2 additions & 2 deletions modules/Cookie Consent/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function __construct(Language $language, Language $cookie_language, Pages

$name = 'Cookie Consent';
$author = '<a href="https://samerton.me" target="_blank" rel="nofollow noopener">Samerton</a>';
$module_version = '2.1.2';
$nameless_version = '2.1.2';
$module_version = '2.1.3';
$nameless_version = '2.1.3';

parent::__construct($this, $name, $author, $module_version, $nameless_version);

Expand Down
2 changes: 1 addition & 1 deletion modules/Core/includes/endpoints/VerifyEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function execute(Nameless2API $api, User $user): void {

$user->update([
'active' => true,
'reset_code' => ''
'reset_code' => null,
]);

EventHandler::executeEvent(new UserValidatedEvent(
Expand Down
4 changes: 2 additions & 2 deletions modules/Core/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function __construct(Language $language, Pages $pages, User $user, Naviga

$name = 'Core';
$author = '<a href="https://samerton.me" target="_blank" rel="nofollow noopener">Samerton</a>';
$module_version = '2.1.2';
$nameless_version = '2.1.2';
$module_version = '2.1.3';
$nameless_version = '2.1.3';

parent::__construct($this, $name, $author, $module_version, $nameless_version);

Expand Down
2 changes: 1 addition & 1 deletion modules/Core/pages/forgot_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Redirect::to(URL::build('/'));
}

if (!isset($_GET['c'])) {
if (empty($_GET['c'])) {
// Enter email address form
if (Input::exists()) {
if (Token::check()) {
Expand Down
2 changes: 1 addition & 1 deletion modules/Core/pages/panel/users_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if ($user_query->active == 0) {
$view_user->update([
'active' => true,
'reset_code' => ''
'reset_code' => null,
]);

EventHandler::executeEvent(new UserValidatedEvent(
Expand Down
4 changes: 2 additions & 2 deletions modules/Discord Integration/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public function __construct(Language $language, Pages $pages, Endpoints $endpoin

$name = 'Discord Integration';
$author = '<a href="https://tadhg.sh" target="_blank" rel="nofollow noopener">Aberdeener</a>';
$module_version = '2.1.2';
$nameless_version = '2.1.2';
$module_version = '2.1.3';
$nameless_version = '2.1.3';

parent::__construct($this, $name, $author, $module_version, $nameless_version);

Expand Down
4 changes: 2 additions & 2 deletions modules/Forum/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function __construct(Language $language, Language $forum_language, Pages

$name = 'Forum';
$author = '<a href="https://samerton.me" target="_blank" rel="nofollow noopener">Samerton</a>';
$module_version = '2.1.2';
$nameless_version = '2.1.2';
$module_version = '2.1.3';
$nameless_version = '2.1.3';

parent::__construct($this, $name, $author, $module_version, $nameless_version);

Expand Down
13 changes: 8 additions & 5 deletions modules/Forum/pages/forum/view_topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,16 @@
}

// Profile fields
$fields = $post_creator->getProfileFields(false, true);
$fields = array_map(
fn($field): object => (object) ['name' => Output::getClean($field->name), 'value' => $field->purifyValue()],
$post_creator->getProfileFields(false, true)
);

// User integrations
$user_integrations = [];
foreach ($post_creator->getIntegrations() as $key => $integrationUser) {
if ($integrationUser->data()->username != null && $integrationUser->data()->show_publicly) {
$fields[] = [
$fields[] = (object) [
'name' => Output::getClean($key),
'value' => Output::getClean($integrationUser->data()->username)
];
Expand All @@ -635,9 +638,9 @@

$forum_placeholders = $post_creator->getForumPlaceholders();
foreach ($forum_placeholders as $forum_placeholder) {
$fields[] = [
'name' => $forum_placeholder->friendly_name,
'value' => $forum_placeholder->value
$fields[] = (object) [
'name' => Output::getClean($forum_placeholder->friendly_name),
'value' => Output::getClean($forum_placeholder->value),
];
}

Expand Down
4 changes: 2 additions & 2 deletions modules/Members/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function __construct(Language $language, Language $members_language, Page

$name = 'Members';
$author = '<a href="https://tadhg.sh" target="_blank" rel="nofollow noopener">Aberdeener</a>';
$module_version = '2.1.2';
$nameless_version = '2.1.2';
$module_version = '2.1.3';
$nameless_version = '2.1.3';

parent::__construct($this, $name, $author, $module_version, $nameless_version);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nameless",
"version": "2.1.2",
"version": "2.1.3",
"repository": "https://github.com/NamelessMC/Nameless",
"license": "MIT",
"private": true,
Expand Down

0 comments on commit c3e7fce

Please sign in to comment.