Make = possible in hotel names.

Results 1 to 10 of 10
  1. #1
    Member timpegel is offline
    MemberRank
    Nov 2015 Join Date
    61Posts

    Make = possible in hotel names.

    Hi RAGE,



    I'd like to make it possible that you can register with a username that includes = or - or . in the name. But when I use those, it'll block the register cause it's a unvalid username. How can I make those valid, so that users can make a name like for example -test. ?


  2. #2
    Apprentice joepvand is offline
    MemberRank
    Feb 2016 Join Date
    21Posts

    Re: Make = possible in hotel names.

    Im no expert but this protects you from SQLI Injection right?

  3. #3
    Member timpegel is offline
    MemberRank
    Nov 2015 Join Date
    61Posts

    Re: Make = possible in hotel names.

    I don't really know. For me it's just that users can use the = or - in their usernames.

  4. #4
    Account Upgraded | Title Enabled! streamhotel is offline
    MemberRank
    Apr 2012 Join Date
    EarthLocation
    511Posts

    Re: Make = possible in hotel names.

    Quote Originally Posted by joepvand View Post
    Im no expert but this protects you from SQLI Injection right?
    It's not a issue if you use prepared statements. I'm very sure it's possible to use things like = in your username. I assume you'll need to edit the username validator. I don't know which CMS you're using?

  5. #5
    The **** Keiz is offline
    MemberRank
    Nov 2015 Join Date
    238Posts

    Re: Make = possible in hotel names.

    It obviously depends on what CMS you are.

  6. #6
    Member timpegel is offline
    MemberRank
    Nov 2015 Join Date
    61Posts

    Re: Make = possible in hotel names.

    I'm using revcms. ( some kind of pear edit, I made it exploit-less. I don't know exactly where it came from but it's revcms.)

    - - - Updated - - -

    Somebody?

  7. #7
    The **** Keiz is offline
    MemberRank
    Nov 2015 Join Date
    238Posts

    Re: Make = possible in hotel names.

    \app\class.users.php:25

    Code:
    if(!preg_match("/^([A-Za-z]){3,15}-([A-Za-z]){3,15}$/", $username))
    EDIT: Thats my RP regex, use something like

    Code:
    /^([A-Za-z0-9=-=.-.]){3,15}$/

  8. #8
    Member timpegel is offline
    MemberRank
    Nov 2015 Join Date
    61Posts

    Re: Make = possible in hotel names.

    Thankyou @Keiz :)

    - - - Updated - - -

    Hmm, pretty sure that must be it. But how can I use this? There's no line for that.


    Code:
    final public function validName($username)         {        if(strlen($username) <= 25 && ctype_alnum($username))                  {                          return true;                  }                                    return false;         }

    Do I need to delete the if <= 25 line? Or just paste the code under it.

  9. #9
    The **** Keiz is offline
    MemberRank
    Nov 2015 Join Date
    238Posts

    Re: Make = possible in hotel names.

    Code:
    final public function validName($username)  
    {
            return preg_match("/^([A-Za-z0-9=-=.-.]){3,15}$/", $username);
    }

  10. #10
    Member timpegel is offline
    MemberRank
    Nov 2015 Join Date
    61Posts

    Re: Make = possible in hotel names.

    Thanks ! @Keiz



Advertisement