diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-31 14:51:04 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-31 14:51:04 +0000 |
commit | 93b4e1c41d20b7a6c729354dbebd99b00bcbe0c2 (patch) | |
tree | 134c1a28d9952328bcd2e090ae8e2c285eea4fea /includes/actions.inc | |
parent | af16eb8007e9eba20c3cf4d08923a3f6a9d41bd5 (diff) | |
download | brdo-93b4e1c41d20b7a6c729354dbebd99b00bcbe0c2.tar.gz brdo-93b4e1c41d20b7a6c729354dbebd99b00bcbe0c2.tar.bz2 |
#203846 by pwolanin and jvandyk: PHP 4 does not allow omitting an object when it is passed by reference, so we need to live with dummy object passing with actions for object-less actions to support PHP 4
Diffstat (limited to 'includes/actions.inc')
-rw-r--r-- | includes/actions.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/actions.inc b/includes/actions.inc index 008410fb4..ac79a7c15 100644 --- a/includes/actions.inc +++ b/includes/actions.inc @@ -11,11 +11,9 @@ * * Given the IDs of actions to perform, find out what the callbacks * for the actions are by querying the database. Then call each callback - * using the function call $function('do', $object, $context, $a1, $2) + * using the function call $function($object, $context, $a1, $2) * where $function is the name of a function written in compliance with - * the action specification; that is, foo($object, $context). The $params - * parameter is an array of stored parameters that have been previously - * configured through the web using actions.module. + * the action specification; that is, foo($object, $context). * * @param $action_ids * The ID of the action to perform. Can be a single action ID or an array @@ -24,6 +22,8 @@ * @param $object * Parameter that will be passed along to the callback. Typically the * object that the action will act on; a node, user or comment object. + * If the action does not act on an object, pass a dummy object. This + * is necessary to support PHP 4 object referencing. * @param $context * Parameter that will be passed along to the callback. $context is a * keyed array containing extra information about what is currently @@ -39,7 +39,7 @@ * An associative array containing the result of the function that * performs the action, keyed on action ID. */ -function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL) { +function actions_do($action_ids, &$object, $context = NULL, $a1 = NULL, $a2 = NULL) { static $stack; $stack++; if ($stack > variable_get('actions_max_stack', 35)) { |