From c73abd0a728437f85352ffeb0dd03a6ebc4dbbef Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Fri, 23 Nov 2012 13:57:57 +0200 Subject: [PATCH] Shortcodes API: Check if this shortcode realy exists then call user function else return empty string --- monstra/engine/shortcodes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monstra/engine/shortcodes.php b/monstra/engine/shortcodes.php index 2454489..74ab6d0 100644 --- a/monstra/engine/shortcodes.php +++ b/monstra/engine/shortcodes.php @@ -180,7 +180,8 @@ } } - return $prefix . call_user_func(Shortcode::$shortcode_tags[$shortcode], $attributes, $matches[5], $shortcode) . $suffix; + // Check if this shortcode realy exists then call user function else return empty string + return (isset(Shortcode::$shortcode_tags[$shortcode])) ? $prefix . call_user_func(Shortcode::$shortcode_tags[$shortcode], $attributes, $matches[5], $shortcode) . $suffix : ''; } } \ No newline at end of file