From be331a38660a37861bd115e7fc543364e8dbb622 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 17 Oct 2012 08:49:55 -0400 Subject: [PATCH] Fixed: FS#2484 - sql error on mysql user selection --- server/plugins-available/nginx_plugin.inc.php | 52 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 22 deletions(-) diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 399cb1e..7a329c1 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1172,7 +1172,7 @@ unset($tmp_redirect_path); unset($tmp_redirect_path_parts); } - if(substr($alias['domain'], 0, 2) === '*.') $domain_rule = '(^|\.)'.$this->_rewrite_quote($alias['domain']); + if(substr($alias['domain'], 0, 2) === '*.') $domain_rule = '(^|\.)'.$this->_rewrite_quote(substr($alias['domain'], 2)); else $domain_rule = '^'.$this->_rewrite_quote($alias['domain']); $rewrite_rules[] = array( 'rewrite_domain' => $domain_rule, 'rewrite_type' => ($alias['redirect_type'] == 'no')?'':$alias['redirect_type'], @@ -1792,7 +1792,11 @@ } if(is_file($data['new']['document_root']."/" . $web_folder . "/stats/index.html")) $app->system->unlink($data['new']['document_root']."/" . $web_folder . "/stats/index.html"); - $app->system->copy("/usr/local/ispconfig/server/conf/awstats_index.php.master",$data['new']['document_root']."/" . $web_folder . "/stats/index.php"); + if(file_exists("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master")) { + $app->system->copy("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master",$data['new']['document_root']."/" . $web_folder . "/stats/index.php"); + } else { + $app->system->copy("/usr/local/ispconfig/server/conf/awstats_index.php.master",$data['new']['document_root']."/" . $web_folder . "/stats/index.php"); + } } //* Delete the awstats configuration file @@ -1904,27 +1908,31 @@ $ini_settings = explode("\n", $custom_php_ini_settings); if(is_array($ini_settings) && !empty($ini_settings)){ foreach($ini_settings as $ini_setting){ - list($key, $value) = explode('=', $ini_setting); - if($value){ - $value = trim($value); - $key = trim($key); - switch (strtolower($value)) { - case '0': - // PHP-FPM might complain about invalid boolean value if you use 0 - $value = 'off'; - case '1': - case 'on': - case 'off': - case 'true': - case 'false': - case 'yes': - case 'no': - $final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value); - break; - default: - $final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value); - } + $ini_setting = trim($ini_setting); + if(substr($ini_setting,0,1) == ';') continue; + if(substr($ini_setting,0,1) == '#') continue; + if(substr($ini_setting,0,2) == '//') continue; + list($key, $value) = explode('=', $ini_setting); + if($value){ + $value = trim($value); + $key = trim($key); + switch (strtolower($value)) { + case '0': + // PHP-FPM might complain about invalid boolean value if you use 0 + $value = 'off'; + case '1': + case 'on': + case 'off': + case 'true': + case 'false': + case 'yes': + case 'no': + $final_php_ini_settings[] = array('ini_setting' => 'php_admin_flag['.$key.'] = '.$value); + break; + default: + $final_php_ini_settings[] = array('ini_setting' => 'php_admin_value['.$key.'] = '.$value); } + } } } } -- Gitblit v1.9.1