Skip to content

Commit

Permalink
Merge pull request #123 from dterweij/6.1.x
Browse files Browse the repository at this point in the history
Secure docroot input field.
  • Loading branch information
dterweij committed Mar 22, 2014
2 parents 0543f2a + c09edab commit 64c025b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kloxo/httpdocs/lib/domain/domainlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ function postAdd()
if(preg_match("/\.\.\//", $web-docroot)){
throw new lxexception("folder_name_may_not_contain_doubledotsslash","");
}
if(preg_match("/.*({|}|%|\"|$|'|`).*/", $web-docroot)){
throw new lxexception("folder_name_may_not_contain_bad_characters","");
}

$this->docroot = coreFfile::getRealpath($this->docroot);

Expand Down Expand Up @@ -648,6 +651,9 @@ function postAdd()
if(preg_match("/\.\.\//", $web-docroot)){
throw new lxexception("folder_name_may_not_contain_doubledotsslash","");
}
if(preg_match("/.*({|}|%|\"|$|'|`).*/", $web-docroot)){
throw new lxexception("folder_name_may_not_contain_bad_characters","");
}

///#656 When adding a subdomain, the Document Root field is not being validated
if (csa($web->docroot, " /")) {
Expand Down
3 changes: 3 additions & 0 deletions kloxo/httpdocs/lib/domain/web/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,9 @@ function updateform($subaction, $param)
if(preg_match("/\.\.\//", $param['docroot'])) {
throw new lxexception("folder_name_may_not_contain_doubledotsslash", "");
}
if(preg_match("/.*({|}|%|\"|$|'|`).*/", $web-docroot)){
throw new lxexception("folder_name_may_not_contain_bad_characters","");
}
return $vlist;

case "blockip":
Expand Down

0 comments on commit 64c025b

Please sign in to comment.