From 0a4658cfb2cb79f09260c99aaecfbcbbc688ee86 Mon Sep 17 00:00:00 2001
From: Dan Chadwick <dan899@gmail.com>
Date: Tue, 23 Aug 2016 09:40:07 -0400
Subject: [PATCH] Issue #2768023 by kanei, DanChadwick: Fixed allow
 #element_validate and select options_callback to be a php callables rather
 than function names.

---
 components/select.inc | 2 +-
 webform.module        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/select.inc b/components/select.inc
index 29bde81..debaf33 100644
--- a/components/select.inc
+++ b/components/select.inc
@@ -984,7 +984,7 @@ function _webform_select_options_callback($name, $component, $flat = FALSE) {
   }
 
   // Execute the callback function.
-  if (isset($info[$name]['options callback']) && function_exists($info[$name]['options callback'])) {
+  if (isset($info[$name]['options callback']) && is_callable($info[$name]['options callback'])) {
     $function = $info[$name]['options callback'];
 
     $arguments = array();
diff --git a/webform.module b/webform.module
index 08930f1..dc20ae1 100644
--- a/webform.module
+++ b/webform.module
@@ -3050,7 +3050,7 @@ function _webform_client_form_validate(&$elements, &$form_state, $form_id = NULL
     // #value data.
     elseif (isset($elements['#element_validate'])) {
       foreach ($elements['#element_validate'] as $function) {
-        if (function_exists($function))  {
+        if (is_callable($function))  {
           $function($elements, $form_state, $form_state['complete form']);
         }
       }
-- 
2.7.1.windows.2

