Skip to Content Skip to Menu

Underscore in username URL becomes %2C

  • nextstep
  • nextstep
  • OFFLINE
  • Posts: 15
  • Thanks: 0
  • Karma: 0
9 years 4 months ago - 9 years 4 months ago #265877 by nextstep
Underscore in username URL becomes %2C was created by nextstep
My usernames are based on surname and first initial. A person named Joe Blow would have a username j.blow

In their profile URL the dot is changed to an underscore. Therefore Joe's profile URL is website.com/info/userprofile/j_blow

I have also created lists that are based on locale and they display a link from a menu. Therefore when a person clicks the link they go to a list of all the people in that locale.

So far so good.

However, when clicking on a person the link has now changed. (This was not the case previously.) Joe'e link is now website.com/info/userprofile/j%2Cblow

...and while the profile is still visible and works fine, I'd like to know how to prevent this from occurring.

How can I stop this please?
Last edit: 9 years 4 months ago by nextstep.

Please Log in or Create an account to join the conversation.

  • nextstep
  • nextstep
  • OFFLINE
  • Posts: 15
  • Thanks: 0
  • Karma: 0
9 years 4 months ago #266146 by nextstep
Replied by nextstep on topic Underscore in username URL becomes %2C
I've been at the owner of the site to upgrade to the CB Subs package, in fact I'd purchased it some years ago out of my own pocket and could not get her to move to it, preferring to do it by paper and mail -- so I let my subs to CBSubs lapse.

Move a few years on, and now she sees the value of a paid subs mode all done online and has asked me to look at reinstating it for 2016.

A sticking point with the members is the underscore issue I'm having. This issue seems to have occurred after either the migration to 2.4 or the recent upgrade with CB.

The problem is the majority of members are very, very illiterate with site building, many unable to make a simple link.

If I have to go to the extent of telling them I'm changing their link to stop the problem happening, I might as well look at changing the entire platform -- probably wordpress as most of the other sites I have have been moved to wordpress -- and save the annual dollars I'd be spending with Joomlapolis and put it into the conversion over to WP.

I understand I need a subs to get proper assistance, but I have paid in the past, I'm trying to get something going now for the future and require a resolution for the owner as to whether I continue on.

Please advise whether or not I can fix the underscore issue.

Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 4 months ago #266174 by krileon
Replied by krileon on topic Underscore in username URL becomes %2C
CB 2.x doesn't convert period to underscore. It converts it to a comma, which is what you're seeing in the URL as %2C is a comma that has been urlencoded. The reason it does this is Joomla htaccess doesn't handle a period in a URL very well so we have to convert it then revert it when parsing the username into user id. So in order to revert it correctly it needs to be an uncommon character, which a comma in a username is rather uncommon enough to not cause issues but an underscore in a username is rather common. You can change the URL rewriting to whatever you want though by modifying our router file found below. Eventually we'll hopefully have a way to configure this via parameters.

components/com_comprofiler/router.php


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • nextstep
  • nextstep
  • OFFLINE
  • Posts: 15
  • Thanks: 0
  • Karma: 0
9 years 3 months ago - 9 years 3 months ago #266439 by nextstep
Hi Kyle, apologies in my delay I'm currently travelling.

Thanks for getting back to me. In hindsight I should have used a dash rather than a dot. And without wanting to contradict you, the dot did display as an underscore rather than a comma -- maybe it was in 1.x versions as I've only noticed the since the migration/upgrade to J 2.4 then J 3.4

Thanks for the router.php info -- after a look through the code, I managed to change the comma to an underscore on the first go -- as I know ZIP about PHP it worked out well. The REM comments in the code gave me enough help.

=======================================
BTW if anyone else is having a similar issue look for this line in router.php:
rawurlencode( str_replace( '.', ',', $username ) );

& replace with the line - or character ie underscore - below:
rawurlencode( str_replace( '.', '_', $username ) );
========================================

One question though, if / when I upgrade CB in future, will the file router.php be overwritten and I'll have to swap the comma for the underscore again?

(On that note, it maybe simpler in the long run to simply change all the user names from dot to underscore and simply email the users the change to user name . Moral of the story -- don't use dots in user names!)

Thanks again, Kyle, I appreciate your help. I'll get back to the site owner and look to get the CBSubs upgrade moving soon.
Last edit: 9 years 3 months ago by nextstep.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum