@@ -1601,22 +1601,20 @@ function maildirmake($maildir_path, $user = '', $subfolder = '', $group = '') {
16011601 $ mail_config = $ app ->getconf ->get_server_config ($ conf ["server_id " ], 'mail ' );
16021602
16031603 if ($ subfolder != '' ) {
1604- $ dir = escapeshellcmd ( $ maildir_path .'/. ' .$ subfolder) ;
1604+ $ dir = $ maildir_path .'/. ' .$ subfolder ;
16051605 } else {
1606- $ dir = escapeshellcmd ( $ maildir_path) ;
1606+ $ dir = $ maildir_path ;
16071607 }
16081608
16091609 if (!is_dir ($ dir )) mkdir ($ dir , 0700 , true );
16101610
16111611 if ($ user != '' && $ user != 'root ' && $ this ->is_user ($ user )) {
1612- $ user = escapeshellcmd ($ user );
16131612 if (is_dir ($ dir )) $ this ->chown ($ dir , $ user );
16141613
16151614 $ chown_mdsub = true ;
16161615 }
16171616
16181617 if ($ group != '' && $ group != 'root ' && $ this ->is_group ($ group )) {
1619- $ group = escapeshellcmd ($ group );
16201618 if (is_dir ($ dir )) $ this ->chgrp ($ dir , $ group );
16211619
16221620 $ chgrp_mdsub = true ;
@@ -1638,7 +1636,7 @@ function maildirmake($maildir_path, $user = '', $subfolder = '', $group = '') {
16381636 // Courier
16391637 if ($ mail_config ['pop3_imap_daemon ' ] == 'courier ' ) {
16401638 if (!is_file ($ maildir_path .'/courierimapsubscribed ' )) {
1641- $ tmp_file = escapeshellcmd ( $ maildir_path .'/courierimapsubscribed ' ) ;
1639+ $ tmp_file = $ maildir_path .'/courierimapsubscribed ' ;
16421640 touch ($ tmp_file );
16431641 chmod ($ tmp_file , 0744 );
16441642 chown ($ tmp_file , 'vmail ' );
@@ -1650,7 +1648,7 @@ function maildirmake($maildir_path, $user = '', $subfolder = '', $group = '') {
16501648 // Dovecot
16511649 if ($ mail_config ['pop3_imap_daemon ' ] == 'dovecot ' ) {
16521650 if (!is_file ($ maildir_path .'/subscriptions ' )) {
1653- $ tmp_file = escapeshellcmd ( $ maildir_path .'/subscriptions ' ) ;
1651+ $ tmp_file = $ maildir_path .'/subscriptions ' ;
16541652 touch ($ tmp_file );
16551653 chmod ($ tmp_file , 0744 );
16561654 chown ($ tmp_file , 'vmail ' );
@@ -2059,6 +2057,10 @@ public function last_exec_retcode() {
20592057
20602058 public function exec_safe ($ cmd ) {
20612059 $ arg_count = func_num_args ();
2060+ if ($ arg_count != substr_count ($ cmd , '? ' ) + 1 ) {
2061+ trigger_error ('Placeholder count not matching argument list. ' , E_USER_WARNING );
2062+ return false ;
2063+ }
20622064 if ($ arg_count > 1 ) {
20632065 $ args = func_get_args ();
20642066
0 commit comments