daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class UploadComponent extends Component {
  2.   private $max_files = 3;
  3.   private $storage = WWW_ROOT.'alarm';
  4.   private $typemine = array
  5.   (        
  6.     'audio/ogg',
  7.     'audio/mpeg',
  8.     'audio/mpeg4-generic',
  9.     'audio/mp4',
  10.     'audio/vorbis'
  11.   );  
  12.   public function sanitize($unsafe)
  13.   {
  14.     settype($result, "string");
  15.     $str = strtolower ($unsafe);
  16.     $str = preg_replace('/[\r\n\t ]+/', '_',  $str);
  17.     $str = preg_replace('/[\"\*\/\:\<\>\?\'\|]+/', '', $str);
  18.     $result = str_replace(' ', '_', $str);
  19.     return $result;
  20.   }
  21.  
  22.   public function send($files)
  23.   {
  24.    debug($this->typemine);
  25.    debug($this->storage);
  26.    debug($this->max_files);
  27.    debug($this–>sanitize('SuperToo'));
  28.    exit();              
  29.   }
  30. }
RAW Paste Data
Top