Skip to content

Commit

Permalink
Fixed issue #14863: Extending core theme using the same core theme name
Browse files Browse the repository at this point in the history
  • Loading branch information
eddylackmann committed Aug 27, 2019
1 parent a9c6ecf commit 482cdfa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/controllers/admin/themes.php
Expand Up @@ -545,8 +545,14 @@ public function templaterename()
public function templatecopy()
{
$copydir = sanitize_dirname(Yii::app()->request->getPost("copydir"));

if (Permission::model()->hasGlobalPermission('templates', 'create')) {
$newname = sanitize_dirname(Yii::app()->request->getPost("newname"));

if(Template::isStandardTemplate($newname)){
Yii::app()->setFlashMessage(sprintf(gT("Directory with the name `%s` already exists - choose another name"), $newname), 'error');
$this->getController()->redirect(array("admin/themeoptions"));
}

if ($newname && $copydir) {
// Copies all the files from one template directory to a new one
Expand Down

0 comments on commit 482cdfa

Please sign in to comment.