17: profile does not exists if username has hyphen

15 years 7 months ago #71824 by amazeika
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

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.

Please Log in to join the conversation.

15 years 7 months ago #71851 by amazeika
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

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.

Please Log in to join the conversation.

15 years 7 months ago #71865 by amazeika
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:1]if ($version == 1) {
// "^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i"«»);
$regex="/^[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]*$/i";[/code:1]

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 [code:1]/[^\w+]/[/code:1]. 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

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.

Please Log in to join the conversation.

15 years 7 months ago #71878 by nant
thanks for pointing this out and trying to debug :)

I will try and replicate and work with Beat for solution.

Please Log in to join the conversation.

15 years 7 months ago #71894 by amazeika
np, I'm glad to help :)

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.

Please Log in to join the conversation.

15 years 7 months ago #72231 by nant
Ok - I can confirm that there is a problem with:

J 1.5.6
SEF enabled

Links like:

www.domain.com/cb-profile/userprofile/nant-test

render

a

This profile does not exist or is no longer available

page.

I guess this should be moved to known issues.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.222 seconds

Facebook Twitter LinkedIn