2020-10-26, 08:33 AM
In https://github.com/mybb/mybb/blob/mybb_1...s.php#L145 , the returned value is checked just using
That means
can't be returned by plugins and that's too restrictive.
IMO we should check the returned value using
There *might* be issues when multiple plugins hook to a same hook if we make changes here, though I'm not sure. But I think it's worth removing the restrict.
Edited:
If a hooked function is called via the variable function https://github.com/mybb/mybb/blob/mybb_1...s.php#L142 , the returned value is what the hooked function returns.
But if a hooked function is called via
I don't quite understand using
if
:if($return_args)
That means
"" (an empty string)
0 (0 as an integer)
0.0 (0 as a float)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)
can't be returned by plugins and that's too restrictive.
IMO we should check the returned value using
isset()
so that only NULL
is excluded.There *might* be issues when multiple plugins hook to a same hook if we make changes here, though I'm not sure. But I think it's worth removing the restrict.
Edited:
If a hooked function is called via the variable function https://github.com/mybb/mybb/blob/mybb_1...s.php#L142 , the returned value is what the hooked function returns.
But if a hooked function is called via
call_user_func_array()
https://github.com/mybb/mybb/blob/mybb_1...s.php#L136 , if the returned value is FALSE, it might also be that call_user_func_array()
is having errors on the hooked function. Ref https://www.php.net/manual/en/function.c...-array.php .I don't quite understand using
call_user_func_array()
over call_user_func()
here. The latter one only returns what the callback returns. Ref https://www.php.net/manual/en/function.c...r-func.php .