Skip to content

Commit

Permalink
Fixed issue: Security problems with uploaded files in administration
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Mar 8, 2013
1 parent dbad629 commit 09b70a1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions application/controllers/admin/question.php
Expand Up @@ -48,8 +48,7 @@ public function import()
if ($action == 'importquestion')
{
$sFullFilepath = Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR . randomChars(20);
$aPathInfo = pathinfo($sFullFilepath);
$sExtension = $aPathInfo['extension'];
$sExtension = pathinfo($_FILES['the_file']['name'], PATHINFO_EXTENSION);

if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $sFullFilepath))
$fatalerror = sprintf($clang->gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."), Yii::app()->getConfig('tempdir'));
Expand Down

0 comments on commit 09b70a1

Please sign in to comment.