Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Wrong Error with Member Registration ??

2»

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2013

    If you want to allow them to use a space you need to add \p{Z} that to the filter

    '/^([\p{L}\p{N}\p{Pd}\p{Pc}\p{Lm}\p{M}\p{Z}]{3,20}+)?$/'

    \p{Z} : any kind of whitespace or invisible separator. the idea here is that you look at the list to see what each one does and then either include it in that line or remove it.

  • Options
    ChanuxChanux Admin of Geek.lk ✭✭
    edited April 2013

    @vrijvlinder you gave me this code before. it is allow to use SPACE, and All Special Char for Username.
    now i want to Allow Only Leters, Numbers, _ (underscore) and . (dot)

    if (!function_exists('ValidateUsername')) {
       function ValidateUsername($Value, $Field = '') {
          if (preg_match('/(^[ ]|[ ]{2}|[ ]$)/', $Value)) return FALSE; // JDJ Fail on leading, trailing or runs of spaces
          return ValidateRegex(
             $Value,
             '/^([\d\w_ ]{3,40})?$/si' // JDJ Allow spaces and 40 char length
          );
       }
    }
    
  • Options
    peregrineperegrine MVP
    edited April 2013

    if you are using this, remove the space then

     '/^([\d\w_ ]{3,40})?$/si' // JDJ Allow spaces and 40 char length
    
    to:
    
     '/^([\d\w_]{3,40})?$/si' // no spaces,  from 3 - 40 letters and numbers, underscore allowed
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2013

    Yes as I explained before the list up there tells you what each one does so you can remove or add the ones you want. I think the one below will do what you want

    '/^([\p{L}\p{N}\p{Pd}\p{Pc}]{3,20}+)?$/'

  • Options
    ChanuxChanux Admin of Geek.lk ✭✭

    @peregrine Perfect. :) Thanx for Kindly Reply
    @vrijvlinder Thank you too

  • Options

    @vrijvlinder said:
    Yes as I explained before the list up there tells you what each one does so you can remove or add the ones you want. I think the one below will do what you want

    '/^([\p{L}\p{N}\p{Pd}\p{Pc}]{3,20}+)?$/'

    Is there a way to make this change this setting with plug-in? Or can plug-in change settings like this?

  • Options

    Yes. plugins can add validations.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.