Commit 6891708d authored by Marius Burkard's avatar Marius Burkard
Browse files

- nginx/apache directives are missing default value

parent b957d5e2
Pipeline #3694 passed with stage
in 7 minutes and 52 seconds
......@@ -44,3 +44,6 @@ ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`;
-- was missing in incremental, inserted for fixing older installations
ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;
ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumtext NULL DEFAULT NULL;
ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;
\ No newline at end of file
......@@ -2046,8 +2046,8 @@ CREATE TABLE `web_domain` (
`stats_password` varchar(255) default NULL,
`stats_type` varchar(255) default 'awstats',
`allow_override` varchar(255) NOT NULL default 'All',
`apache_directives` mediumtext,
`nginx_directives` mediumtext,
`apache_directives` mediumtext NULL DEFAULT NULL,
`nginx_directives` mediumtext NULL DEFAULT NULL,
`php_fpm_use_socket` ENUM('n','y') NOT NULL DEFAULT 'y',
`php_fpm_chroot` enum('n','y') NOT NULL DEFAULT 'n',
`pm` enum('static','dynamic','ondemand') NOT NULL DEFAULT 'ondemand',
......
......@@ -1186,6 +1186,11 @@ class apache2_plugin {
$vhost_data['apache_directives'] = $snippet['snippet'];
}
}
if(!$vhost_data['apache_directives']) {
$vhost_data['apache_directives'] = ''; // ensure it is not null
}
// Make sure we only have Unix linebreaks
$vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']);
$vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']);
......
......@@ -1200,6 +1200,9 @@ class nginx_plugin {
$nginx_directives = $data['new']['nginx_directives'];
// $vhost_data['enable_pagespeed'] = false;
}
if(!$nginx_directives) {
$nginx_directives = ''; // ensure it is not null
}
// folder_directive_snippets
if(trim($data['new']['folder_directive_snippets']) != ''){
......
......@@ -111,7 +111,9 @@ class nginx_reverseproxy_plugin {
$crt_file = $ssl_dir.'/'.$domain.'.crt';
$bundle_file = $ssl_dir.'/'.$domain.'.bundle';
$vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']);
if($vhost_data['nginx_directives']) {
$vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']);
}
if($data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment