diff options
author | emkael <emkael@tlen.pl> | 2016-04-25 12:13:33 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-04-25 12:13:33 +0200 |
commit | 0dda5b8c12573779a1e2b7e820284dafe04956e3 (patch) | |
tree | b0b238b79387138c057d544d48ed1e4b3e64c9ba /app/php/components/SafeFileUploadMethods.php | |
parent | 050c6cfd0e75249ae7b7dad3f8ec6eed6be50102 (diff) |
* splitting traits for safer file upload components
Diffstat (limited to 'app/php/components/SafeFileUploadMethods.php')
-rw-r--r-- | app/php/components/SafeFileUploadMethods.php | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/app/php/components/SafeFileUploadMethods.php b/app/php/components/SafeFileUploadMethods.php deleted file mode 100644 index bdb2af6..0000000 --- a/app/php/components/SafeFileUploadMethods.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -trait SafeFileUploadMethods { - - protected $_isSecure = TRUE; - - public function getIsSecure() { - return $this->_isSecure; - } - - public function setIsSecure($bool) { - $this->_isSecure = $bool; - } - - public function getFileType() { - if ($this->getIsSecure()) { - $fileInfo = new finfo(FILEINFO_MIME_TYPE); - return $fileInfo->file($this->getLocalName()); - } - return parent::getFileType(); - } - - public function getFileSize() { - if ($this->getIsSecure()) { - return filesize($this->getLocalName()); - } - return parent::getFileSize(); - } - -} - -?> |