Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Strip function for strings
- * @param string with text
- * @return string
- */
- private function stripSingle($inputStripSingle){
- return stripslashes(htmlentities(strip_tags(trim($inputStripSingle))));
- }
- /*
- * Strip function for passwords
- * @param string with text
- * @return string
- */
- public function sanitizePassword($inputPassword){
- $inputPassword = preg_replace('/[^0-9a-zA-Z]/', '',$inputPassword);
- return $this->stripSingle($inputPassword);
- }
- /*
- * Strip function for usernames
- * @param string with text
- * @return string
- */
- public function sanitizeUsername($inputUsername){
- $inputUsername = preg_replace('/[^0-9a-zA-Z\@\.]/', '',$inputUsername);
- return $this->stripSingle($inputUsername);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement