Last active
February 1, 2017 22:28
-
-
Save onionstand/c66744ac360753b63c2b3f027b35c111 to your computer and use it in GitHub Desktop.
Clean string for php mail function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function cleanForMail($str_for_mail) { | |
| $val=trim(stripslashes(strip_tags($str_for_mail))); | |
| $pattern = '/[\r\n]|Content-Type:|Bcc:|Cc:/i'; | |
| if (preg_match($pattern, $val)){ | |
| $val = NULL; | |
| } | |
| return $val; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment