View Single Post
  #7  
Old 31st July 2008, 20:56
bolero bolero is offline
Senior Member
 
Join Date: Apr 2008
Posts: 114
Thanks: 2
Thanked 8 Times in 8 Posts
Default Fix for 2.2.24 mailuser bug

Ok, here's the fix. It's a stupid confusion about a variable name. The bug is in mailuser/mail/table/user.table.php. "user_name" is actually *not* the "username" (that would be user_username), but the user's name/comment field. Thus it allows many more characters than this check:
"/^[0-9a-zA-Z_\-\.]{0,255}$/"
This check will fail with any normal name as a full name is guaranteed to contain a space. Quick fix:
Code:
$table['user_name'] = array(         'datatype'                 => "VARCHAR",
                                                                          'formtype'                 => "TEXT",
                                                                          'regex'                        => "/^[0-9a-zA-Z_\-\.\s]{0,255}$/",
                                                                          'errmsg'                => "Name contains invalid charcters.",
                                                                          'value'                 => "");
The \s was added by me. This will allow spaces and thus fix this issue for 99%of the situations. The check should be even more loose, though. Could somebody submit the check from version 2.2.23, please? user.table.php should be reverted to that version.
Reply With Quote