mirror of https://github.com/pixelfed/pixelfed.git
Merge pull request #4746 from pixelfed/staging
Update AP helpers, improve preferredUsername validation
This commit is contained in:
commit
d20efd2c61
|
@ -45,6 +45,7 @@
|
|||
- Update AccountImport ([5a2d7e3e](https://github.com/pixelfed/pixelfed/commit/5a2d7e3e))
|
||||
- Update ImportPostController, fix IG bug with missing spaces between hashtags ([9c24157a](https://github.com/pixelfed/pixelfed/commit/9c24157a))
|
||||
- Update ApiV1Controller, fix mutes in home feed ([ddc21714](https://github.com/pixelfed/pixelfed/commit/ddc21714))
|
||||
- Update AP helpers, improve preferredUsername validation ([21218c79](https://github.com/pixelfed/pixelfed/commit/21218c79))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9)
|
||||
|
|
|
@ -760,6 +760,13 @@ class Helpers {
|
|||
if(!isset($res['preferredUsername']) && !isset($res['nickname'])) {
|
||||
return;
|
||||
}
|
||||
// skip invalid usernames
|
||||
if(!ctype_alnum($res['preferredUsername'])) {
|
||||
$tmpUsername = str_replace(['_', '.', '-'], '', $res['preferredUsername']);
|
||||
if(!ctype_alnum($tmpUsername)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
$username = (string) Purify::clean($res['preferredUsername'] ?? $res['nickname']);
|
||||
if(empty($username)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue