@@ -101,7 +101,7 @@ function ssl($event_name, $data) {
101101 // load the server configuration options
102102 $ app ->uses ('getconf ' );
103103 $ web_config = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'web ' );
104- if ($ web_config ['CA_path ' ]!= '' && !file_exists ($ web_config ['CA_path ' ].'/openssl.cnf ' ))
104+ if (isset ( $ web_config ['CA_path ' ]) && $ web_config [ ' CA_path ' ] != '' && !file_exists ($ web_config ['CA_path ' ].'/openssl.cnf ' ))
105105 $ app ->log ("CA path error, file does not exist: " .$ web_config ['CA_path ' ].'/openssl.cnf ' , LOGLEVEL_ERROR );
106106
107107 //* Only vhosts can have a ssl cert
@@ -693,7 +693,7 @@ function update($event_name, $data) {
693693
694694 // Get the client ID
695695 $ client = $ app ->dbmaster ->queryOneRecord ('SELECT client_id FROM sys_group WHERE sys_group.groupid = ? ' , $ data ['new ' ]['sys_groupid ' ]);
696- $ client_id = intval ($ client ['client_id ' ]);
696+ $ client_id = ( is_array ( $ client )) ? intval ($ client ['client_id ' ]) : 0 ;
697697 unset($ client );
698698
699699 // Remove old symlinks, if site is renamed
@@ -1277,7 +1277,7 @@ function update($event_name, $data) {
12771277 }
12781278
12791279 // folder_directive_snippets
1280- if (trim ($ data ['new ' ]['folder_directive_snippets ' ]) != '' ){
1280+ if (isset ( $ data [ ' new ' ][ ' folder_directive_snippets ' ]) && ! is_null ( $ data [ ' new ' ][ ' folder_directive_snippets ' ]) && trim ($ data ['new ' ]['folder_directive_snippets ' ]) != '' ){
12811281 $ data ['new ' ]['folder_directive_snippets ' ] = trim ($ data ['new ' ]['folder_directive_snippets ' ]);
12821282 $ data ['new ' ]['folder_directive_snippets ' ] = str_replace ("\r\n" , "\n" , $ data ['new ' ]['folder_directive_snippets ' ]);
12831283 $ data ['new ' ]['folder_directive_snippets ' ] = str_replace ("\r" , "\n" , $ data ['new ' ]['folder_directive_snippets ' ]);
@@ -1627,7 +1627,7 @@ function update($event_name, $data) {
16271627 $ server_alias = array ();
16281628
16291629 // get autoalias
1630- $ auto_alias = $ web_config ['website_autoalias ' ];
1630+ $ auto_alias = ( isset ( $ web_config ['website_autoalias ' ]))? $ web_config [ ' website_autoalias ' ]: '' ;
16311631 if ($ auto_alias != '' ) {
16321632 // get the client username
16331633 $ client = $ app ->db ->queryOneRecord ("SELECT `username` FROM `client` WHERE `client_id` = ? " , $ client_id );
@@ -1968,7 +1968,7 @@ function update($event_name, $data) {
19681968
19691969 // create password file for stats directory
19701970 if (!is_file ($ data ['new ' ]['document_root ' ].'/ ' . $ stats_web_folder . '/stats/.htpasswd_stats ' ) || $ data ['new ' ]['stats_password ' ] != $ data ['old ' ]['stats_password ' ]) {
1971- if (trim ($ data ['new ' ]['stats_password ' ]) != '' ) {
1971+ if (isset ( $ data [ ' new ' ][ ' stats_password ' ]) && ! is_null ( $ data [ ' new ' ][ ' stats_password ' ]) && trim ($ data ['new ' ]['stats_password ' ]) != '' ) {
19721972 $ htp_file = 'admin: ' .trim ($ data ['new ' ]['stats_password ' ]);
19731973 $ app ->system ->file_put_contents ($ data ['new ' ]['document_root ' ].'/ ' . $ stats_web_folder . '/stats/.htpasswd_stats ' , $ htp_file );
19741974 $ app ->system ->chmod ($ data ['new ' ]['document_root ' ].'/ ' . $ stats_web_folder . '/stats/.htpasswd_stats ' , 0755 );
@@ -2961,7 +2961,7 @@ private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name,
29612961
29622962 // Custom php.ini settings
29632963 $ final_php_ini_settings = array ();
2964- $ custom_php_ini_settings = trim ($ data ['new ' ]['custom_php_ini ' ]);
2964+ $ custom_php_ini_settings = ( isset ( $ data [ ' new ' ][ ' custom_php_ini ' ]) && ! is_null ( $ data [ ' new ' ][ ' custom_php_ini ' ])) ? trim ($ data ['new ' ]['custom_php_ini ' ]) : '' ;
29652965
29662966 if (intval ($ data ['new ' ]['directive_snippets_id ' ]) > 0 ){
29672967 $ snippet = $ app ->db ->queryOneRecord ("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y' " , intval ($ data ['new ' ]['directive_snippets_id ' ]));
0 commit comments