#231 create mailbox: use call_user_func

Core (82)
Bilal Ahmed

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);

Bilal Ahmed


  • Bilal Ahmed

    Bilal Ahmed - 2011-01-19
    • priority: 5 --> 9
  • Christian Boltz

    Christian Boltz - 2011-02-17
    • priority: 9 --> 5
    • summary: create mailbox has an error --> create mailbox: use call_user_func
  • Christian Boltz

    Christian Boltz - 2011-02-17

    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.

  • Christian Boltz

    Christian Boltz - 2016-05-15
    • status: open --> closed-works-for-me
  • Christian Boltz

    Christian Boltz - 2016-05-15

    Just checked this again. PHP officially supports variable functions (http://php.net/manual/functions.variable-functions.php), so I see no need to switch to call_user_func().

    If keeping the existing code causes a real-world problem, feel free to reopen ;-)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks