@@ -1812,6 +1812,8 @@ function web_folder_delete($event_name,$data) {
18121812
18131813 if (preg_match ('/ ' . preg_quote ($ begin_marker , '/ ' ) . '(.*?) ' . preg_quote ($ end_marker , '/ ' ) . '/s ' , $ ht_file , $ matches )) {
18141814 $ ht_file = str_replace ($ matches [0 ], '' , $ ht_file );
1815+ } else {
1816+ $ ht_file = str_replace ("AuthType Basic \nAuthName \"Members Only \"\nAuthUserFile " .$ folder_path .".htpasswd \nrequire valid-user " , '' , $ ht_file );
18151817 }
18161818
18171819 if (trim ($ ht_file ) == '' ) {
@@ -1890,6 +1892,8 @@ function web_folder_update($event_name,$data) {
18901892
18911893 if (preg_match ('/ ' . preg_quote ($ begin_marker , '/ ' ) . '(.*?) ' . preg_quote ($ end_marker , '/ ' ) . '/s ' , $ ht_file , $ matches )) {
18921894 $ ht_file = str_replace ($ matches [0 ], '' , $ ht_file );
1895+ } else {
1896+ $ ht_file = str_replace ("AuthType Basic \nAuthName \"Members Only \"\nAuthUserFile " .$ old_folder_path .".htpasswd \nrequire valid-user " , '' , $ ht_file );
18931897 }
18941898
18951899 if (trim ($ ht_file ) == '' ) {
@@ -1930,6 +1934,8 @@ function web_folder_update($event_name,$data) {
19301934
19311935 if (preg_match ('/ ' . preg_quote ($ begin_marker , '/ ' ) . '(.*?) ' . preg_quote ($ end_marker , '/ ' ) . '/s ' , $ ht_file , $ matches )) {
19321936 $ ht_file = str_replace ($ matches [0 ], '' , $ ht_file );
1937+ } else {
1938+ $ ht_file = str_replace ("AuthType Basic \nAuthName \"Members Only \"\nAuthUserFile " .$ new_folder_path .".htpasswd \nrequire valid-user " , '' , $ ht_file );
19331939 }
19341940
19351941 if (trim ($ ht_file ) == '' ) {
0 commit comments