summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-06-02 14:39:17 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-06-02 14:39:17 +0200
commitbeb6fdb72185fdc7dafee97426364c59178885e7 (patch)
tree3f3d0483fcf1e5a5fde6030ed9514e8124cd7b01
parent7e9f0e4beb727b44ec327ffc299b20a2bcf4038a (diff)
c/file/do_upload: fix fallback if base64_decode fails
trim() would give us an empty string if base64_decode() returns false. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/file.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index b26ebcf37..cb95edf0c 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -602,7 +602,7 @@ class File extends CI_Controller {
// TODO: this interface currently sets the same filename for every file if you use multiupload
$filename = $this->input->post("filename");
if ($filename !== false) {
- $filename = trim(base64_decode($filename, true), "\r\n\0\t\x0B");
+ $filename = base64_decode($filename, true);
}
// fall back if base64_decode failed
@@ -610,6 +610,8 @@ class File extends CI_Controller {
$filename = $file['name'];
}
+ $filename = trim($filename, "\r\n\0\t\x0B");
+
$folder = $this->mfile->folder($hash);
file_exists($folder) || mkdir ($folder);
$file_path = $this->mfile->file($hash);