Created
June 19, 2017 12:59
-
-
Save HumanG33k/3dc1ae6a535be43f5bfd18508827e66d to your computer and use it in GitHub Desktop.
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
class UploadComponent extends Component { | |
private $max_files = 3; | |
private $storage = WWW_ROOT.'alarm'; | |
private $typemine = array | |
( | |
'audio/ogg', | |
'audio/mpeg', | |
'audio/mpeg4-generic', | |
'audio/mp4', | |
'audio/vorbis' | |
); | |
public function sanitize($unsafe) | |
{ | |
settype($result, "string"); | |
$str = strtolower ($unsafe); | |
$str = preg_replace('/[\r\n\t ]+/', '_', $str); | |
$str = preg_replace('/[\"\*\/\:\<\>\?\'\|]+/', '', $str); | |
$result = str_replace(' ', '_', $str); | |
return $result; | |
} | |
public function send($files) | |
{ | |
debug($this->typemine); | |
debug($this->storage); | |
debug($this->max_files); | |
debug($this–>sanitize('SuperToo')); | |
exit(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment