From e703c45441561bb6fe03032d1a49800a15e8cd25 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 23 Oct 2016 09:37:47 -0700 Subject: [PATCH] Fixes #1858 - Generic avatar displayed when {USER_AVATAR} contains no parms. --- e107_core/shortcodes/single/user_avatar.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/e107_core/shortcodes/single/user_avatar.php b/e107_core/shortcodes/single/user_avatar.php index 03eab598c..47ed230a4 100644 --- a/e107_core/shortcodes/single/user_avatar.php +++ b/e107_core/shortcodes/single/user_avatar.php @@ -1,15 +1,19 @@ toAvatar(); so full arrays can be passed to it. +function user_avatar_shortcode($parm=null) { - if(is_string($parm)) + if(!empty($parm) && is_string($parm)) { $data = array('user_image'=>$parm); } - elseif(is_array($parm)) + elseif(!empty($parm) && is_array($parm)) { $data = $parm; } + else + { + $data = null; + } return e107::getParser()->toAvatar($data, $data); /* @@ -100,4 +104,3 @@ function user_avatar_shortcode($parm=null) //TODO new function $tp->toAvatar(); */ } -?> \ No newline at end of file