Jump to content

Special characters within password field, not allowed ?


Recommended Posts

Hi,
i used the search function but for my question i didn't find an answer...

I found out it's not possible to use special characters for passwords (accounts). I tried to use the @ within my password then i received the message "password is invalid"

How can i change this or what can be done?

Thanks a lot
rgds
dmsman2

Link to comment
Share on other sites

  • 1 month later...

open file validate.php in classes dir, search for isPasswd function, there is what simbols can be it set to 0-9 and a-z you can change it but i don't know how it efect regeneration and so on i on presta few days only.

Link to comment
Share on other sites

Hi Tommix,
thanks for your hint!

The good thing is, we now know which lines we may have to change to allow special characters :-)

validate.php ->

       /**
   * Check for password validity
   *
   * @param string $passwd Password to validate
   * @return boolean Validity is ok or not
   */
   static public function isPasswd($passwd, $size = 5)
   {
       return preg_match('/^[.a-z_0-9-]{'.$size.',32}$/ui', $passwd);
   }

   static public function isPasswdAdmin($passwd)
   {
       return self::isPasswd($passwd, 8);
   }

   /**
   * Check for configuration key validity
   *
   * @param string $configName Configuration key to validate
   * @return boolean Validity is ok or not
   */
   static public function isConfigName($configName)
   {
       return preg_match('/^[a-z_0-9-]+$/ui', $configName);
   }


The bad thing is, i'm a beginner too, no idea how to change this regular expressions.

My problem is, i have a few customers know, which complaining about the password security!
They asking me, why can't we use some characters like "#", "+", "?", "$" or for example the "!"....

A question to the coders out there :-)

How do we have to change/add the code above to allow some more special characters ? And are there any other changes in other files needed ?

Thanks a lot !

Link to comment
Share on other sites

  • 1 year later...

No luck for me there -- I have both a + and a } in one of my passwords but the error: smtp: passowrd is invalid and I had tried to incorporate the { } and + into the prg_match expression.

any way to do this? I do NOT want to be FORCED to change a password because passwords should be secure as a person has them and this doesn't allow these charachters.

need help please

Link to comment
Share on other sites

In PrestaShop v1.3, more possible symbols have been added to the password. Line 424 of classes/Validate.php is now the following, which allows !@#$%\^&*() to be used:

return preg_match('/^[.a-z_0-9-!@#$%\^&*()]{'.$size.',32}$/ui', $passwd);



Is this enough, or do you really need {}+ as well?

Link to comment
Share on other sites

  • 3 months later...

Rocky, do you know how I can get rid off the "special characters allowed" pop-up? This is driving me crazy every time I go to enter text into one of these fields, i have to click again to actually enter anything. This box also is obscuring information in the text field below. Really dumb feature if you ask me...

29716_8cW3qCA8zZndgt9ngSLs_t

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...