From 93b4e1c41d20b7a6c729354dbebd99b00bcbe0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 31 Dec 2007 14:51:04 +0000 Subject: #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 --- includes/actions.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'includes/actions.inc') 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)) { -- cgit v1.2.3