Skip to Content Skip to Menu

[SOLVED] Question Mark in Username

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago - 6 years 5 months ago #304521 by bascherz
[SOLVED] Question Mark in Username was created by bascherz
I have never messed with the username field on any of my sites. It was bound to happen at some point...someone used a question mark in their username, which CB accepted, and now it is impossible to visit that person's profile. Instead, the link directs whoever clicks it to their own profile.

Thought you might want to know about this and suggest a validation other than "any string" (the default) for usernames and even change the default to something that does not conflict with how CB works.

Regards,
Bruce

Bruce S - Vienna, VA
Last edit: 6 years 5 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • nant
  • nant
  • ONLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
6 years 5 months ago #304522 by nant
Replied by nant on topic Question Mark in Username

bascherz wrote: I have never messed with the username field on any of my sites. It was bound to happen at some point...someone used a question mark in their username, which CB accepted, and now it is impossible to visit that person's profile. Instead, the link directs whoever clicks it to their own profile.

Thought you might want to know about this and suggest a validation other than "any string" (the default) for usernames and even change the default to something that does not conflict with how CB works.

Regards,
Bruce


Hmm, I am pretty sure that CB follows Joomla validation for usernames

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

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago #304523 by bascherz
Replied by bascherz on topic Question Mark in Username
Hi Nant...

That's quite possible. But Joomla doesn't use the username to form a path to a person's profile like CB does, does it? That's the problem it is causing. I am hoping that by specifying a Perl RegEx validation on the entry CB does that on the username before it gets submitted to Joomla for whatever validation it does.

Thanks,
Bruce

Bruce S - Vienna, VA

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 5 months ago #304537 by krileon
Replied by krileon on topic Question Mark in Username
It's not possible for a question mark to render in the SEF URL. The question mark will be replaced with a dash. Example as follows.

User ID: 50
Username: question?mark
URL: 50-question-mark

If using unicode aliases you'd have the below.

URL: 50-questionmark


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.

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago #304545 by bascherz
Replied by bascherz on topic Question Mark in Username
Hmmm... Now I'll have to go figure out where I saw it happen. It's quite possible it was a link my own code formed using substitutions, which wouldn't surprise me at all. I'll reply again when I figure it out. Thanks, Kyle.

Bruce S - Vienna, VA

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

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago - 6 years 5 months ago #304556 by bascherz
Replied by bascherz on topic Question Mark in Username
It had to have been some link I created using substitution but which is no longer on the affected site. The links in the site member lists all work as you describe. What I was doing was a little specific.

I customized the "Who's Online" module "User Text" box to conditionally show links to the user's profile using Regular Labs Conditional Content plugin so that I could publicly show who is online by name without the links being there (just the names). I constructed the links as "/menuitem/profile/[username]", which works for every user except the one whose username ends with a question mark. In that case, the link goes to MY (the current user) profile.

So I looked more into field substitution and found this:
Code:
[cb:url location="profile_view" /]

Which always takes the current user to their own profile. So I thought maybe I could modify it as follows (but none of these worked):
Code:
[cb:url location="profile_view" user="[username]" /]
or
Code:
[cb:url location="profile_view" user="[user_id]" /]
or
Code:
[cb:url location="profile_view" username="[username]" /]

Maybe I just need to know more about how the User Text box for the "Who's Online" module works.

Bruce

Bruce S - Vienna, VA
Last edit: 6 years 5 months ago by bascherz.

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

Moderators: beatnantkrileon
Powered by Kunena Forum