From 0d99e376e1c26aa097157560f8ea118a26751406 Mon Sep 17 00:00:00 2001 From: foksisko Date: Sat, 12 Dec 2015 06:39:24 +0000 Subject: [PATCH] Throw fatal error when the parameter $callable in $shortcode->add() is a closure https://github.com/getherbert/herbert/issues/65 --- Herbert/Framework/Shortcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Herbert/Framework/Shortcode.php b/Herbert/Framework/Shortcode.php index 4e99072..25b65b4 100644 --- a/Herbert/Framework/Shortcode.php +++ b/Herbert/Framework/Shortcode.php @@ -41,7 +41,7 @@ public function add($name, $callable, $arguments = []) $attributes = $this->renameArguments($arguments, $attributes); } - if (strpos($callable, '::') !== false) + if (is_string($callable) && strpos($callable, '::') !== false) { list($api, $method) = explode('::', $callable);