[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX] A blank page shows up after validating user creation with a username containing a space

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <699c69d5ba07e_3b18702c76882@gitlab-sidekiq-low-urgency-cpu-bound-v2-5b77bfdff7-7njhx.mail>

Adrien Mbuya Maloba pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
0f6a3697 by Adrien Mbuya Maloba at 2026-02-23T16:44:10+02:00
[BP][FIX] A blank page shows up after validating user creation with a username containing a space
---
* [FIX] A blank page shows up after validating user creation with a username containing a space

See merge request tikiwiki/tiki!9631

- - - - -


2 changed files:

- lib/registration/registrationlib.php
- tiki-adminusers.php


Changes:

=====================================
lib/registration/registrationlib.php
=====================================
@@ -264,7 +264,7 @@ class RegistrationLib extends TikiLib
             }
 
             if (! preg_match($userlib::USERNAME_MANDATORY_VALIDATION_PATTERN, $registration['name'])) {
-                return tra("Username cannot contain any spaces");
+                $errors[] = new RegistrationError('name', tra('Username cannot contain any spaces'));
             }
 
             if ($prefs['login_is_email'] != 'y') {
@@ -301,7 +301,7 @@ class RegistrationLib extends TikiLib
             }
 
             if (! preg_match($userlib::USERNAME_MANDATORY_VALIDATION_PATTERN, $registration['name'])) {
-                return tra("Username cannot contain any spaces.");
+                $errors[] = new RegistrationError('name', tra('Username cannot contain any spaces.'));
             }
 
             // Check the mode


=====================================
tiki-adminusers.php
=====================================
@@ -291,7 +291,8 @@ if (isset($_REQUEST['batch']) && is_uploaded_file($_FILES['csvlist']['tmp_name']
         $AddUser = false;
     }
     if (! preg_match($userlib::USERNAME_MANDATORY_VALIDATION_PATTERN, $_REQUEST['login'])) {
-        return tra("Username cannot contain any spaces");
+        $errors[] = tra('Username cannot contain any spaces');
+        $AddUser = false;
     }
     if ($prefs['login_is_email'] == 'y' && ! validate_email($_REQUEST['login'])) {
         $errors[] = tra('Invalid email') . ' ' . $_REQUEST['login'];



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0f6a36978f80426fffd3b5151cd70ba9e97f7460

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0f6a36978f80426fffd3b5151cd70ba9e97f7460
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.