From dfe234a7aaaacedcc94716f955b44a1b50c4a057 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 6 Apr 2016 13:50:31 +0200 Subject: * components -> controls --- app/php/controls/SafeFileUpload.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/php/controls/SafeFileUpload.php (limited to 'app/php/controls/SafeFileUpload.php') diff --git a/app/php/controls/SafeFileUpload.php b/app/php/controls/SafeFileUpload.php new file mode 100644 index 0000000..98e120a --- /dev/null +++ b/app/php/controls/SafeFileUpload.php @@ -0,0 +1,34 @@ +_isSecure; + } + + public function setIsSecure($bool) { + $this->_isSecure = $bool; + } + + public function getFileType() { + $type = parent::getFileType(); + if ($this->getIsSecure()) { + $fileInfo = new finfo(FILEINFO_MIME_TYPE); + return $fileInfo->file($this->getLocalName()); + } + else { + return $type; + } + } + +} + +?> -- cgit v1.2.3