Skip to content

Commit 2aaf93e

Browse files
committed
Fixed: FS#1599 - Changing webdomain doesn't change PHP open_basedir
1 parent 400d554 commit 2aaf93e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

interface/web/sites/web_domain_edit.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,16 @@ function onAfterUpdate() {
563563
unset($subdomain);
564564
}
565565

566-
//* Set allow_override and php_open_basedir if empty
566+
//* Set allow_override if empty
567567
if($web_rec['allow_override'] == '') {
568568
$sql = "UPDATE web_domain SET allow_override = '".$app->db->quote($web_config["htaccess_allow_override"])."' WHERE domain_id = ".$this->id;
569569
$app->db->query($sql);
570570
}
571-
if($web_rec['php_open_basedir'] == '' || (isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"])) {
571+
572+
//* Set php_open_basedir if empty or domain or client has been changed
573+
if($web_rec['php_open_basedir'] == '' ||
574+
($this->dataRecord["domain"] != '' && $this->oldDataRecord["domain"] != '' && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) ||
575+
(isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"]))
572576
$document_root = $app->db->quote(str_replace("[client_id]",$client_id,$document_root));
573577
$php_open_basedir = str_replace("[website_path]",$document_root,$web_config["php_open_basedir"]);
574578
$php_open_basedir = $app->db->quote(str_replace("[website_domain]",$web_rec['domain'],$php_open_basedir));

0 commit comments

Comments
 (0)