Skip to content

Commit

Permalink
add check for writable parent dir templates/
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrgay committed Feb 3, 2018
1 parent ff5d693 commit 8092427
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion template_editor/edit_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
header('Location: index.php');
exit;
}
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type)){
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type) || !is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/')){
$msg->addWarning('TEMPLATE_DIR_NOT_WRITABLE');
$temp_unwritable = TRUE;
}else{
Expand Down
2 changes: 1 addition & 1 deletion template_editor/edit_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$type = "page_templates";
$template=$_GET['temp'];
// non existing template name
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type)){
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type)|| !is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/')){
$msg->addWarning('TEMPLATE_DIR_NOT_WRITABLE');
$temp_unwritable = TRUE;
}else{
Expand Down
2 changes: 1 addition & 1 deletion template_editor/edit_structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Header('Location: index.php');
exit;
}
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type)){
if(!is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/'.$type) || !is_writable($_SERVER['DOCUMENT_ROOT'].$_base_path.'templates/')){
$msg->addWarning('TEMPLATE_DIR_NOT_WRITABLE');
$temp_unwritable = TRUE;
}else{
Expand Down

0 comments on commit 8092427

Please sign in to comment.