1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Fix null and undefined issues in user_shortcodes.php

This commit is contained in:
Nick Liu
2020-11-28 18:06:51 +01:00
parent 645e162253
commit 05dbdb8625

View File

@@ -21,6 +21,8 @@ class user_shortcodes extends e_shortcode
function __construct() function __construct()
{ {
parent::__construct();
$pref = e107::getPref(); $pref = e107::getPref();
$this->commentsDisabled = vartrue($pref['comments_disabled']); $this->commentsDisabled = vartrue($pref['comments_disabled']);
@@ -797,7 +799,7 @@ class user_shortcodes extends e_shortcode
$extended_record = str_replace("EXTENDED_VALUE","USER_EXTENDED={$key}.value.{$this->var['user_id']}", $extended_record); $extended_record = str_replace("EXTENDED_VALUE","USER_EXTENDED={$key}.value.{$this->var['user_id']}", $extended_record);
$extended_record = str_replace('{EXTENDED_ID}',$frm->name2id('user_'.$key), $extended_record); $extended_record = str_replace('{EXTENDED_ID}',$frm->name2id('user_'.$key), $extended_record);
if(HIDE_EMPTY_FIELDS === TRUE) if(defined('HIDE_EMPTY_FIELDS') && HIDE_EMPTY_FIELDS === TRUE)
{ {
$this_value = $tp->parseTemplate("{USER_EXTENDED={$key}.value.{$this->var['user_id']}}", TRUE); $this_value = $tp->parseTemplate("{USER_EXTENDED={$key}.value.{$this->var['user_id']}}", TRUE);