Skip to content

Instantly share code, notes, and snippets.

@HumanG33k
Created June 19, 2017 12:59
Show Gist options
  • Save HumanG33k/3dc1ae6a535be43f5bfd18508827e66d to your computer and use it in GitHub Desktop.
Save HumanG33k/3dc1ae6a535be43f5bfd18508827e66d to your computer and use it in GitHub Desktop.
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