summaryrefslogtreecommitdiff
path: root/app/php/components/SafeFileUpload.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/components/SafeFileUpload.php')
-rw-r--r--app/php/components/SafeFileUpload.php33
1 files changed, 3 insertions, 30 deletions
diff --git a/app/php/components/SafeFileUpload.php b/app/php/components/SafeFileUpload.php
index ea65d22..dcc81a0 100644
--- a/app/php/components/SafeFileUpload.php
+++ b/app/php/components/SafeFileUpload.php
@@ -1,37 +1,10 @@
<?php
-class SafeFileUpload extends TFileUpload {
-
- use MimeTypeCheckForFileUpload;
-
-}
-
-trait MimeTypeCheckForFileUpload {
+Prado::using('Application.components.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();
- }
+class SafeFileUpload extends TFileUpload {
- public function getFileSize() {
- if ($this->getIsSecure()) {
- return filesize($this->getLocalName());
- }
- return parent::getFileSize();
- }
+ use SafeFileUploadMethods;
}