Merge pull request #13862 from Raroun/fix_for_issue_13837_External_profile_image_URL_wrongly_redirect_to_default_-avatar_URL_for_all-digits_usernames

fix for issue #13837 External profile image URL wrongly redirect to default avatar URL for all-digits usernames
This commit is contained in:
Hypolite Petovan 2024-01-30 09:43:58 -05:00 committed by GitHub
commit e9554c32c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 79 additions and 59 deletions

View File

@ -284,7 +284,19 @@ class Register extends BaseModule
$regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']]; $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata)); DI::baseUrl()->redirect('register?' . http_build_query($regdata));
} }
//Check if nickname contains only US-ASCII and do not start with a digit
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9]*$/', $arr['nickname'])) {
if (is_numeric(substr($arr['nickname'], 0, 1))) {
DI::sysmsg()->addNotice(DI::l10n()->t("Nickname cannot start with a digit."));
} else {
DI::sysmsg()->addNotice(DI::l10n()->t("Nickname can only contain US-ASCII characters."));
}
$regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata));
return;
}
$arr['blocked'] = $blocked; $arr['blocked'] = $blocked;
$arr['verified'] = $verified; $arr['verified'] = $verified;
$arr['language'] = L10n::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language')); $arr['language'] = L10n::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language'));

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2024.03-dev\n" "Project-Id-Version: 2024.03-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-29 06:46+0000\n" "POT-Creation-Date: 2024-01-30 15:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -1755,30 +1755,30 @@ msgid ""
"Contact birthday events are private to you." "Contact birthday events are private to you."
msgstr "" msgstr ""
#: src/Content/GroupManager.php:148 src/Content/Nav.php:278 #: src/Content/GroupManager.php:147 src/Content/Nav.php:278
#: src/Content/Text/HTML.php:881 src/Content/Widget.php:537 #: src/Content/Text/HTML.php:881 src/Content/Widget.php:537
#: src/Model/User.php:1381 #: src/Model/User.php:1381
msgid "Groups" msgid "Groups"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:150 #: src/Content/GroupManager.php:149
msgid "External link to group" msgid "External link to group"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:154 src/Content/Widget.php:512 #: src/Content/GroupManager.php:153 src/Content/Widget.php:512
msgid "show less" msgid "show less"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:155 src/Content/Widget.php:410 #: src/Content/GroupManager.php:154 src/Content/Widget.php:410
#: src/Content/Widget.php:513 #: src/Content/Widget.php:513
msgid "show more" msgid "show more"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:156 #: src/Content/GroupManager.php:155
msgid "Create new group" msgid "Create new group"
msgstr "" msgstr ""
#: src/Content/Item.php:332 src/Model/Item.php:3244 #: src/Content/Item.php:332 src/Model/Item.php:3246
msgid "event" msgid "event"
msgstr "" msgstr ""
@ -1786,7 +1786,7 @@ msgstr ""
msgid "status" msgid "status"
msgstr "" msgstr ""
#: src/Content/Item.php:341 src/Model/Item.php:3246 #: src/Content/Item.php:341 src/Model/Item.php:3248
#: src/Module/Post/Tag/Add.php:123 #: src/Module/Post/Tag/Add.php:123
msgid "photo" msgid "photo"
msgstr "" msgstr ""
@ -2199,8 +2199,8 @@ msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s" "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1005 src/Model/Item.php:3977 #: src/Content/Text/BBCode.php:1005 src/Model/Item.php:3979
#: src/Model/Item.php:3983 src/Model/Item.php:3984 #: src/Model/Item.php:3985 src/Model/Item.php:3986
msgid "Link to source" msgid "Link to source"
msgstr "" msgstr ""
@ -2748,8 +2748,8 @@ msgstr ""
#: src/Core/Installer.php:516 #: src/Core/Installer.php:516
msgid "" msgid ""
"The web installer needs to be able to create a file called \"local.config.php" "The web installer needs to be able to create a file called \"local.config."
"\" in the \"config\" folder of your web server and it is unable to do so." "php\" in the \"config\" folder of your web server and it is unable to do so."
msgstr "" msgstr ""
#: src/Core/Installer.php:517 #: src/Core/Installer.php:517
@ -2867,7 +2867,7 @@ msgstr ""
msgid "Could not connect to database." msgid "Could not connect to database."
msgstr "" msgstr ""
#: src/Core/L10n.php:444 src/Model/Item.php:2288 #: src/Core/L10n.php:444 src/Model/Item.php:2290
msgid "Undetermined" msgid "Undetermined"
msgstr "" msgstr ""
@ -3429,91 +3429,91 @@ msgstr ""
msgid "Happy Birthday %s" msgid "Happy Birthday %s"
msgstr "" msgstr ""
#: src/Model/Item.php:2295 #: src/Model/Item.php:2297
#, php-format #, php-format
msgid "%s (%s - %s): %s" msgid "%s (%s - %s): %s"
msgstr "" msgstr ""
#: src/Model/Item.php:2297 #: src/Model/Item.php:2299
#, php-format #, php-format
msgid "%s (%s): %s" msgid "%s (%s): %s"
msgstr "" msgstr ""
#: src/Model/Item.php:2300 #: src/Model/Item.php:2302
#, php-format #, php-format
msgid "Detected languages in this post:\\n%s" msgid "Detected languages in this post:\\n%s"
msgstr "" msgstr ""
#: src/Model/Item.php:3248 #: src/Model/Item.php:3250
msgid "activity" msgid "activity"
msgstr "" msgstr ""
#: src/Model/Item.php:3250 #: src/Model/Item.php:3252
msgid "comment" msgid "comment"
msgstr "" msgstr ""
#: src/Model/Item.php:3253 src/Module/Post/Tag/Add.php:123 #: src/Model/Item.php:3255 src/Module/Post/Tag/Add.php:123
msgid "post" msgid "post"
msgstr "" msgstr ""
#: src/Model/Item.php:3423
#, php-format
msgid "%s is blocked"
msgstr ""
#: src/Model/Item.php:3425 #: src/Model/Item.php:3425
#, php-format #, php-format
msgid "%s is ignored" msgid "%s is blocked"
msgstr "" msgstr ""
#: src/Model/Item.php:3427 #: src/Model/Item.php:3427
#, php-format #, php-format
msgid "%s is ignored"
msgstr ""
#: src/Model/Item.php:3429
#, php-format
msgid "Content from %s is collapsed" msgid "Content from %s is collapsed"
msgstr "" msgstr ""
#: src/Model/Item.php:3431 #: src/Model/Item.php:3433
#, php-format #, php-format
msgid "Content warning: %s" msgid "Content warning: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:3884 #: src/Model/Item.php:3886
msgid "bytes" msgid "bytes"
msgstr "" msgstr ""
#: src/Model/Item.php:3915 #: src/Model/Item.php:3917
#, php-format #, php-format
msgid "%2$s (%3$d%%, %1$d vote)" msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)" msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3917 #: src/Model/Item.php:3919
#, php-format #, php-format
msgid "%2$s (%1$d vote)" msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)" msgid_plural "%2$s (%1$d votes)"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3922 #: src/Model/Item.php:3924
#, php-format #, php-format
msgid "%d voter. Poll end: %s" msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s" msgid_plural "%d voters. Poll end: %s"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3924 #: src/Model/Item.php:3926
#, php-format #, php-format
msgid "%d voter." msgid "%d voter."
msgid_plural "%d voters." msgid_plural "%d voters."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3926 #: src/Model/Item.php:3928
#, php-format #, php-format
msgid "Poll end: %s" msgid "Poll end: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:3960 src/Model/Item.php:3961 #: src/Model/Item.php:3962 src/Model/Item.php:3963
msgid "View on separate page" msgid "View on separate page"
msgstr "" msgstr ""
@ -3909,8 +3909,8 @@ msgid ""
"profile\n" "profile\n"
"\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n" "\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n"
"\n" "\n"
"\t\t\tWe recommend adding a profile photo, adding some profile \"keywords" "\t\t\tWe recommend adding a profile photo, adding some profile "
"\" (very useful\n" "\"keywords\" (very useful\n"
"\t\t\tin making new friends) - and perhaps what country you live in; if you " "\t\t\tin making new friends) - and perhaps what country you live in; if you "
"do not wish\n" "do not wish\n"
"\t\t\tto be more specific than that.\n" "\t\t\tto be more specific than that.\n"
@ -5657,9 +5657,9 @@ msgstr ""
#: src/Module/Admin/Summary.php:98 #: src/Module/Admin/Summary.php:98
msgid "" msgid ""
"The last update failed. Please run \"php bin/console.php dbstructure update" "The last update failed. Please run \"php bin/console.php dbstructure "
"\" from the command line and have a look at the errors that might appear. " "update\" from the command line and have a look at the errors that might "
"(Some of the errors are possibly inside the logfile.)" "appear. (Some of the errors are possibly inside the logfile.)"
msgstr "" msgstr ""
#: src/Module/Admin/Summary.php:102 #: src/Module/Admin/Summary.php:102
@ -5810,8 +5810,8 @@ msgstr ""
#, php-format #, php-format
msgid "" msgid ""
"Show some informations regarding the needed information to operate the node " "Show some informations regarding the needed information to operate the node "
"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer" "according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener "
"\">EU-GDPR</a>." "noreferrer\">EU-GDPR</a>."
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:81 #: src/Module/Admin/Tos.php:81
@ -9123,8 +9123,8 @@ msgstr ""
#: src/Module/Profile/Profile.php:158 #: src/Module/Profile/Profile.php:158
#, php-format #, php-format
msgid "" msgid ""
"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" class=" "You're currently viewing your profile as <b>%s</b> <a href=\"%s\" "
"\"btn btn-sm pull-right\">Cancel</a>" "class=\"btn btn-sm pull-right\">Cancel</a>"
msgstr "" msgstr ""
#: src/Module/Profile/Profile.php:167 #: src/Module/Profile/Profile.php:167
@ -9361,40 +9361,48 @@ msgstr ""
msgid "Please enter the identical mail address in the second field." msgid "Please enter the identical mail address in the second field."
msgstr "" msgstr ""
#: src/Module/Register.php:310 #: src/Module/Register.php:292
msgid "Nickname cannot start with a digit."
msgstr ""
#: src/Module/Register.php:295
msgid "Nickname can only contain US-ASCII characters."
msgstr ""
#: src/Module/Register.php:324
msgid "The additional account was created." msgid "The additional account was created."
msgstr "" msgstr ""
#: src/Module/Register.php:335 #: src/Module/Register.php:349
msgid "" msgid ""
"Registration successful. Please check your email for further instructions." "Registration successful. Please check your email for further instructions."
msgstr "" msgstr ""
#: src/Module/Register.php:342 #: src/Module/Register.php:356
#, php-format #, php-format
msgid "" msgid ""
"Failed to send email message. Here your accout details:<br> login: %s<br> " "Failed to send email message. Here your accout details:<br> login: %s<br> "
"password: %s<br><br>You can change your password after login." "password: %s<br><br>You can change your password after login."
msgstr "" msgstr ""
#: src/Module/Register.php:348 #: src/Module/Register.php:362
msgid "Registration successful." msgid "Registration successful."
msgstr "" msgstr ""
#: src/Module/Register.php:357 src/Module/Register.php:364 #: src/Module/Register.php:371 src/Module/Register.php:378
#: src/Module/Register.php:374 #: src/Module/Register.php:388
msgid "Your registration can not be processed." msgid "Your registration can not be processed."
msgstr "" msgstr ""
#: src/Module/Register.php:363 #: src/Module/Register.php:377
msgid "You have to leave a request note for the admin." msgid "You have to leave a request note for the admin."
msgstr "" msgstr ""
#: src/Module/Register.php:373 #: src/Module/Register.php:387
msgid "An internal error occured." msgid "An internal error occured."
msgstr "" msgstr ""
#: src/Module/Register.php:395 #: src/Module/Register.php:409
msgid "Your registration is pending approval by the site owner." msgid "Your registration is pending approval by the site owner."
msgstr "" msgstr ""
@ -9636,8 +9644,8 @@ msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:100 #: src/Module/Security/TwoFactor/Verify.php:100
#, php-format #, php-format
msgid "" msgid ""
"If you do not have access to your authentication code you can use a <a href=" "If you do not have access to your authentication code you can use a <a "
"\"%s\">two-factor recovery code</a>." "href=\"%s\">two-factor recovery code</a>."
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:101 #: src/Module/Security/TwoFactor/Verify.php:101
@ -11316,8 +11324,8 @@ msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:152 #: src/Module/Settings/TwoFactor/Verify.php:152
#, php-format #, php-format
msgid "" msgid ""
"<p>Or you can open the following URL in your mobile device:</p><p><a href=" "<p>Or you can open the following URL in your mobile device:</p><p><a "
"\"%s\">%s</a></p>" "href=\"%s\">%s</a></p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:159 #: src/Module/Settings/TwoFactor/Verify.php:159
@ -11426,9 +11434,9 @@ msgstr ""
msgid "" msgid ""
"At any point in time a logged in user can export their account data from the " "At any point in time a logged in user can export their account data from the "
"<a href=\"%1$s/settings/userexport\">account settings</a>. If the user wants " "<a href=\"%1$s/settings/userexport\">account settings</a>. If the user wants "
"to delete their account they can do so at <a href=\"%1$s/settings/removeme\">" "to delete their account they can do so at <a href=\"%1$s/settings/"
"%1$s/settings/removeme</a>. The deletion of the account will be permanent. " "removeme\">%1$s/settings/removeme</a>. The deletion of the account will be "
"Deletion of the data will also be requested from the nodes of the " "permanent. Deletion of the data will also be requested from the nodes of the "
"communication partners." "communication partners."
msgstr "" msgstr ""