From cbe4ca710bb0794d0b419b915a3115035477d9ee Mon Sep 17 00:00:00 2001
From: peter <mail@pebosi.net>
Date: Wed, 16 Mar 2011 14:06:54 +0100
Subject: [PATCH] Issue #[1094548] by [pebosi]: Error with undefined functions in actions.inc

---
 includes/actions.inc |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/includes/actions.inc b/includes/actions.inc
index f997535..a66dea1 100644
--- a/includes/actions.inc
+++ b/includes/actions.inc
@@ -128,7 +128,9 @@ function actions_do($action_ids, &$object, $context = NULL, $a1 = NULL, $a2 = NU
       }
       // Singleton action; $action_id is the function name.
       else {
-        $result[$action_id] = $action_id($object, $context, $a1, $a2);
+        if (function_exists($action_id)) {
+          $result[$action_id] = $action_id($object, $context, $a1, $a2);
+        }
       }
     }
   }
@@ -148,7 +150,9 @@ function actions_do($action_ids, &$object, $context = NULL, $a1 = NULL, $a2 = NU
     }
     // Singleton action; $action_ids is the function name.
     else {
-      $result[$action_ids] = $action_ids($object, $context, $a1, $a2);
+      if (function_exists($action_ids)) {
+        $result[$action_ids] = $action_ids($object, $context, $a1, $a2);
+      }
     }
   }
   $stack--;
--
1.7.4.1

