This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

REGEX
#1

Hello,

Thank you for the huge ammount of time you devoted to make commentics and to help the forum users.

There may be a bug in your program code concerning the username, inter alia:
I don't think that this is wanted since the error message which displays in frontend is "The name must start with a letter and optionally contain - & ".

In functions/form.php from line 150, your Reg Ex (in preg_replace) strips the numbers in $cmtx_default_name, even if there is only one between the letters. Which leads to the above non comprehensive error message.

Solution is to replace the reg ex:
Code:
/[^\p{L}&\-\'. ]/u
with
Code:
/[^\p{L}\p{N}*&\-\'. ]/u

And it's fixed.

You can test it here : http://www.solmetra.com/scripts/regex/index.php

Edit : Sorry for the double post, it was a misuse of the browser back button.
Reply
#2

Hi gulian,

Thanks for your bug report. However the regex was *meant* to strip numbers and I think the error message supports that. The error message says that only a letter, a dash, an ampersand, a single quote or a period is allowed. So, as a number is not in that list, it is rightfully stripped. Your change is to allow a number, and that's fine if that's how you want it to work, but I'm not sure that it's a "bug" because a number was never meant to be allowed.

Have you completed the interview?
Reply
#3

Ok,

The error message does not says "only a letter" or "only letters", it says "The name must start with a letter..."
Reply
#4

This is also because I did not see either any reasons why numbers could have been banned in a nickname/username, in the conception of commentics
Reply
#5

It's because the name field is designed to be the person's name and not a username.

Have you completed the interview?
Reply
#6

ok I understand. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)