From 35ad3e72849ba1b46ee3e0eaa808a60cbb88a0a3 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 28 Nov 2020 14:24:43 -0800 Subject: [PATCH] Issue #4217 - incorrect comment avatar. --- e107_core/shortcodes/batch/comment_shortcodes.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php index c5150b4b8..8ba49994a 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -112,15 +112,11 @@ class comment_shortcodes extends e_shortcode { $tp = e107::getParser(); - // return $this->var['user_image']; - // $url = $tp->thumbUrl($this->var['user_image']); - // $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'],USERIMAGE)."}"); - // $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_id']."}"); - // Posting a new comment (check that it is not an existing comment by anonymous user) - #3813 & 3829 - if($this->var['comment_author_id'] != '0' && USERID) + // https://github.com/e107inc/e107/issues/4217 + if(!isset($this->var['comment_author_id']) && USERID) // assumes we are writing a new comment, not displaying an existing one. { - $userdata = e107::user(USERID); + $userdata = e107::user(USERID); $this->var = array_merge($this->var, $userdata); } @@ -134,6 +130,9 @@ class comment_shortcodes extends e_shortcode $text .= ''; $text .= ''; + /* unset($this->var['user_prefs']); + $text .= print_a($this->var,true);*/ + return $text; }