|
|
17: profile does not exists if username has hyphen
|
|
Date: 2008/08/20 23:06
|
By: amazeika
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 14 |   | |
|
I just got this error an hour ago, a user registered and his profile cannot be reached. I got the profile does not exist message.
I noticed that this is the only user with an inaccessible profile and he is the only one with an hyphen (-) on his username. I created a user with an hyphen, same problem. I tried to find a solution but it seems there is none at this moment.
I also notice that if I disable the SEF, his profile can be reached using the link provided by the list. Disabling SEF is not a solution for me. Could anybody help me please?. I'm running Joomla 1.5.3 and CB RC2.
Thx
Edit: added number to subject
Post edited by: beat, at: 2008/08/25 23:28
|
|
The topic has been locked. |
|
|
|
Re:profile does not exists if username has hyphen
|
|
Date: 2008/08/21 11:47
|
By: amazeika
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 14 |   | |
|
at least, in the meantime, is there an easy way (some code modification) to prevent users from choosing usernames with hyphens or characters that may lead to this error. I just need a little push, I'm a programmer myself but still not too familiarized with the Joomla API.
Thanks
Arunas
|
|
The topic has been locked. |
|
|
|
Re:profile does not exists if username has hyphen
|
|
Date: 2008/08/21 13:44
|
By: amazeika
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 14 |   | |
|
I did a little search in the CB code and found a problem with a regexp in the validate function in components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php. I think there is something wrong with this regexp:
| Code: | if ($version == 1) {
// "^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");
$regex="/^[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]*$/i";
|
It will only match if the username only has these characters or it’s an empty string because of the beginning and end of string delimiters (^ and $). Please correct me if I’m wrong, I’ve done regexps before but I’m not an expert in the matter and they tend to be tricky.
I’ve changed the regexp to something more straightforward as . This way it only match when non-alphanumeric characters are present.
I suppose that the profile does not exist problem with Joomla SEF enabled was not taken into account since usernames are not supposed to have non-alphanumeric characters.
Please correct me if I'm wrong.
Arunas
Post edited by: amazeika, at: 2008/08/21 13:46
Post edited by: amazeika, at: 2008/08/21 13:47
Post edited by: amazeika, at: 2008/08/21 13:49
Post edited by: amazeika, at: 2008/08/21 13:54
|
|
The topic has been locked. |
|
|
|
Re:profile does not exists if username has hyphen
|
|
Date: 2008/08/21 16:38
|
By: amazeika
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 14 |   | |
|
np, I'm glad to help
|
|
The topic has been locked. |
|
|