Wedge
Public area => Bug reports => The Pub => Archived fixes => Topic started by: live627 on June 10th, 2013, 09:20 AM
-
The profile area (and all other areas) are limited by the old method of procedural function calls, checked by function_exists(). I'd like to ask for this to be changed to is_callable and call_user_func_array throughout.
I already made this change to the profile area like so:
@@ -529,7 +529,7 @@
}
// Make sure that the area function does exist!
- if (!isset($profile_include_data['function']) || !function_exists($profile_include_data['function']))
+ if (!isset($profile_include_data['function']) || !is_callable($profile_include_data['function']))
{
destroyMenu();
fatal_lang_error('no_access', false);
@@ -696,7 +696,7 @@
redirectexit('action=profile' . (we::$user['is_owner'] ? '' : ';u=' . $memID) . ';area=' . $current_area);
// Call the appropriate subaction function.
- $profile_include_data['function']($memID);
+ call_user_func_array($profile_include_data['function'], array($memID));
// Set the page title if it's not already set...
if (!isset($context['page_title']))
Sample code to make use of this:
'function' => array('Awards\Profile', 'showAwards'),
-
Yeah, it's bugged me for a while - r2162 fixes that (and replicates the function to scheduled tasks)
-
Are you also going to fix up any other area, such as admin?
-
Yeah, don't see why not.
-
Thank you.
-
So, admin menu, moderate menu, what else?
-
Media menu