#231 create mailbox: use call_user_func

v2.3.2
open
nobody
Core (82)
5
2011-02-17
2011-01-19
Bilal Ahmed
No

Dear Sir,
create-mailbox.php has an error at line no 162 that has a if statement

if($CONF['maildir_name_hook'] != 'NO' && function_exists($CONF['maildir_name_hook'])) {
$hook_func = $CONF['maildir_name_hook'];
$maildir = $hook_func ($fDomain, $fUsername);
}

that should be changed as below

if($CONF['maildir_name_hook'] != 'NO' && function_exists('maildir_name_hook')) {
$maildir = call_user_func('maildir_name_hook', $fDomain, $fUsername);
}

Thanks
Bilal Ahmed

Discussion

  • Bilal Ahmed
    Bilal Ahmed
    2011-01-19

    • priority: 5 --> 9
     
    • priority: 9 --> 5
    • summary: create mailbox has an error --> create mailbox: use call_user_func
     
  • I wouldn't call this an error with highest priority (= release blocker) ;-) - it's just another (maybe not-so-good, but working) method to call the user function.

    Nevertheless, thanks for pointing this out!

    I just see on http://de.php.net/call_user_func a user comment (from Dec 2008) saying
    "<?php call_user_func()?> and <?php call_user_func_array()?> hide some errors (notices, warnings and maybe errors), even if is display_errors turned on and error_Reporting is set to E_ALL|E_STRICT"

    This doesn't sound like what we want. I'll have to test the behaviour of call_user_func() regarding error messages before changing the code.