Skip to content

Commit

Permalink
Fixed issue #9183: Template upload: "zip" is added to the templatename
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Sep 10, 2014
1 parent dbc26a8 commit 5e901c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/templates.php
Expand Up @@ -111,9 +111,9 @@ public function upload()
Yii::app()->loadLibrary('admin.pclzip');

$zip = new PclZip($_FILES['the_file']['tmp_name']);

// Create temporary directory so that if dangerous content is unzipped it would be unaccessible
$sNewDirectoryName=sanitize_dirname($_FILES['the_file']['name']);
$sNewDirectoryName=sanitize_dirname(pathinfo($_FILES['the_file']['name'], PATHINFO_FILENAME ));
$destdir = Yii::app()->getConfig('usertemplaterootdir').DIRECTORY_SEPARATOR.$sNewDirectoryName;

if (!is_writeable(dirname($destdir)))
Expand Down

0 comments on commit 5e901c6

Please sign in to comment.