Advertisement
Guest User

Untitled

a guest
May 10th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1.         /*
  2.          *  Strip function for strings
  3.          *  @param string with text
  4.          *  @return string
  5.          */
  6.         private function stripSingle($inputStripSingle){
  7.             return stripslashes(htmlentities(strip_tags(trim($inputStripSingle))));
  8.         }
  9.  
  10.         /*
  11.          *  Strip function for passwords
  12.          *  @param string with text
  13.          *  @return string
  14.          */
  15.         public function sanitizePassword($inputPassword){
  16.             $inputPassword = preg_replace('/[^0-9a-zA-Z]/', '',$inputPassword);
  17.             return $this->stripSingle($inputPassword);
  18.  
  19.         }
  20.  
  21.         /*
  22.          *  Strip function for usernames
  23.          *  @param string with text
  24.          *  @return string
  25.          */
  26.         public function sanitizeUsername($inputUsername){
  27.             $inputUsername = preg_replace('/[^0-9a-zA-Z\@\.]/', '',$inputUsername);
  28.             return $this->stripSingle($inputUsername);
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement