Skip to content

Commit c7e58bf

Browse files
author
Marius Burkard
committed
Merge branch 'apache2-plugin-directivesnippet' into 'develop'
Custom PHP variables are not apply when configured in Directive Snippet See merge request ispconfig/ispconfig3!1209
2 parents 695761b + 3a93952 commit c7e58bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,13 +1247,16 @@ function update($event_name, $data) {
12471247
}
12481248

12491249
//* Create custom php.ini
1250-
if(trim($data['new']['custom_php_ini']) != '') {
1250+
# Because of custom default PHP directives from snippet
1251+
# php.ini custom values order os: 1. general settings 2. Directive Snippets settings 3. custom php.ini settings defined in domain settings
1252+
if(trim($data['new']['custom_php_ini']) != '' || $data['new']['directive_snippets_id'] > "0") {
12511253
$has_custom_php_ini = true;
12521254
$custom_sendmail_path = false;
12531255
if(!is_dir($custom_php_ini_dir)) $app->system->mkdirpath($custom_php_ini_dir);
12541256

12551257
$php_ini_content = $this->get_master_php_ini_content($data['new']);
1256-
$php_ini_content .= str_replace("\r", '', trim($data['new']['custom_php_ini']));
1258+
1259+
$php_ini_content .= "\n".str_replace("\r", '', trim($data['new']['custom_php_ini']));
12571260

12581261
if(intval($data['new']['directive_snippets_id']) > 0){
12591262
$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
@@ -1266,6 +1269,7 @@ function update($event_name, $data) {
12661269
$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
12671270
$php_snippet['snippet'] = trim($php_snippet['snippet']);
12681271
if($php_snippet['snippet'] != ''){
1272+
$php_snippet['snippet'] = str_replace("\r", '', $php_snippet['snippet']);
12691273
$php_ini_content .= "\n".$php_snippet['snippet'];
12701274
}
12711275
}

0 commit comments

Comments
 (0)