Skip to content

Commit

Permalink
PHP file check corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
telerim committed May 24, 2015
1 parent 5fabc57 commit b711127
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Controller/UploadsController.php
Expand Up @@ -44,12 +44,12 @@ public function upload($dir=null) {
}
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name'];
if ($this->endsWith($tempFile, ".php")) {
$result = array('error' => 'You are not allowed to upload PHP files for security reasons.');
}
$targetPath = $dir;
$targetFile = $targetPath . $_FILES['file']['name'];
$fileSize = filesize($tempFile);
if ($this->endsWith($targetFile, ".php")) {
$result = array('error' => 'You are not allowed to upload PHP files for security reasons.');
}
if ($fileSize > $sizeLimit) {
$result = array('error' => 'File is too large. Please ask server admin to increase the file upload limit.');
}
Expand Down

0 comments on commit b711127

Please sign in to comment.