mardi 4 août 2015

Does regex special character allowing security break?

My regex looks like this.

    if (preg_match("/^[a-zA-Z0-9~@#$^*()_+=[\]{}|\\,.?: -]*$/", $text) == FALSE) {
      echo 'Wrong!'
    }

I want to allow special characters ' and " sign too. How should I better implement it? And whether it is a security break for mysql database.

Aucun commentaire:

Enregistrer un commentaire