PageTemplate/Fixup

* Don't try to be smart with the helper methods as they are used to escape user input.
This commit is contained in:
Sarjuuk 2026-01-26 20:01:26 +01:00
parent c6d92031c5
commit e675a8f953
5 changed files with 23 additions and 17 deletions

View file

@ -30,10 +30,10 @@ if (($this->lvTabs && count($this->lvTabs)) || $this->charactersLvData || $this-
echo $this->lvTabs;
if ($this->charactersLvData):
echo ' us_addCharactersTab('.$this->json('charactersLvData').');'.PHP_EOL;
echo ' us_addCharactersTab('.$this->json('charactersLvData', varRef: true).');'.PHP_EOL;
endif;
if ($this->profilesLvData):
echo ' us_addProfilesTab('.$this->json('profilesLvData').');'.PHP_EOL;
echo ' us_addProfilesTab('.$this->json('profilesLvData', varRef: true).');'.PHP_EOL;
endif;
if ($this->contribute & CONTRIBUTE_CO):
echo " new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments".($this->lvTabs ? ", tabs: ".$this->lvTabs->__tabVar : '').", parent: 'lv-generic', data: lv_comments});".PHP_EOL;

View file

@ -15,7 +15,7 @@ if ($this->contribute & CONTRIBUTE_VI):
endif;
if ($this->gPageInfo):
echo " var g_pageInfo = ".$this->json('gPageInfo').";\n";
echo " var g_pageInfo = ".$this->json('gPageInfo', varRef: true).";\n";
// set by ItemBaseEndpoint
if ($this->user::isLoggedIn() && !empty($this->redButtons[BUTTON_EQUIP])):
@ -27,7 +27,7 @@ if ($this->pageTemplate):
if ($this->locale->value && $this->pageTemplate['pageName'] != 'home'):
echo " Locale.set(".$this->locale->value.");\n";
endif;
echo " PageTemplate.set(".$this->json('pageTemplate').");\n";
echo " PageTemplate.set(".$this->json('pageTemplate', varRef: true).");\n";
endif;
echo " PageTemplate.init();\n";

View file

@ -24,7 +24,7 @@
?>
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">
$WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?=substr($this->json('userIcon'), 1, -1); ?>));
$WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?=substr($this->json('userIcon', varRef: true), 1, -1); ?>));
</script>
<h1 class="h1-icon"><?=$this->h1; ?></h1>
<?php else: ?>