Skip to content

Commit 245cfde

Browse files
authored
release(v3.5.2): relax username validation + stdClass namespace fix
- users(core): allow dots/@ in usernames and block "." / ".." to prevent path-like edge cases - php(core): namespace stdClass return to \stdClass for consistency under FileRise\Domain - admin: update sponsor list (add Stefan)
1 parent 9c84731 commit 245cfde

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## Changes 02/26/2026 (v3.5.2)
4+
5+
`release(v3.5.2): relax username validation + stdClass namespace fix`
6+
7+
**Commit message**
8+
9+
```text
10+
release(v3.5.2): relax username validation + stdClass namespace fix
11+
12+
- users(core): allow dots/@ in usernames and block "." / ".." to prevent path-like edge cases
13+
- php(core): namespace stdClass return to \stdClass for consistency under FileRise\Domain
14+
- admin: update sponsor list (add Stefan)
15+
```
16+
17+
**Changed**
18+
19+
- **Username validation**
20+
- Updated `REGEX_USER` to allow `.` and `@` in usernames (and spaces/underscores/dashes as before).
21+
- Added a negative lookahead to reject `.` and `..` as standalone usernames.
22+
- **PHP namespace correctness**
23+
- `UserModel::getUserPermissions()` now returns `\stdClass` (global) instead of `stdClass` to avoid namespace resolution issues under `FileRise\Domain`.
24+
- **Admin sponsor page**
25+
- Added “Stefan” to the sponsors list in `public/js/adminSponsor.js`.
26+
27+
---
28+
329
## Changes 02/19/2026 (v3.5.1)
430

531
`release(v3.5.1): authenticated Link File deep links + shared file request mode`

config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
define('REGEX_FOLDER_NAME','/^(?!^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$)(?!.*[. ]$)(?:[^<>:"\/\\\\|?*\x00-\x1F]{1,255})(?:[\/\\\\][^<>:"\/\\\\|?*\x00-\x1F]{1,255})*$/xu');
4444
define('PATTERN_FOLDER_NAME','[\p{L}\p{N}_\-\s\/\\\\]+');
4545
define('REGEX_FILE_NAME', '/^[^\x00-\x1F\/\\\\]{1,255}$/u');
46-
define('REGEX_USER', '/^[\p{L}\p{N}_\- ]+$/u');
46+
define('REGEX_USER', '/^(?!\.{1,2}$)[\p{L}\p{N}_\- .@]+$/u');
4747
define('FR_DEMO_MODE', false);
4848

4949
date_default_timezone_set(TIMEZONE);

public/js/adminSponsor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const DEFAULT_SUPPORTERS = [
3535
'@jubnl',
3636
'Juozaitis S',
3737
'Cocoseb31',
38-
'nulltrope'
38+
'nulltrope',
39+
'Stefan'
3940
];
4041

4142
/**

src/FileRise/Domain/UserModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public static function getUserPermissions()
420420
}
421421
}
422422

423-
return new stdClass();
423+
return new \stdClass();
424424
}
425425

426426
/**

0 commit comments

Comments
 (0)