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

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6998bc6c8ad90_3b186e106405b@gitlab-sidekiq-low-urgency-cpu-bound-v2-5855f6dd75-9tkdq.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
c5e92df7 by Adrien Mbuya Maloba at 2026-02-20T19:48:23+00:00
[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!9624

- - - - -


2 changed files:

- lib/Registration/RegistrationLib.php
- tiki-adminusers.php


Changes:

=====================================
lib/Registration/RegistrationLib.php
=====================================
@@ -267,7 +267,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') {
@@ -304,7 +304,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
=====================================
@@ -310,7 +310,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/c5e92df75cc468787d317eeaee5036f90bb5d571

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c5e92df75cc468787d317eeaee5036f90bb5d571
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.