Skip to content

Commit f47ba4e

Browse files
committed
Remove unnecessary @ and replace all other @ with unsafe:
1 parent 5dc402c commit f47ba4e

16 files changed

Lines changed: 82 additions & 82 deletions

com.woltlab.wcf/templates/__menu.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{event name='menuBefore'}
44

55
{foreach from=$menuItemNodeList item=menuItemNode}
6-
<li class="{if $menuItemNode->isActiveNode()}active{/if}{if $menuItemNode->hasChildren()} boxMenuHasChildren{/if}" data-identifier="{@$menuItemNode->identifier}">
6+
<li class="{if $menuItemNode->isActiveNode()}active{/if}{if $menuItemNode->hasChildren()} boxMenuHasChildren{/if}" data-identifier="{$menuItemNode->identifier}">
77
<a {anchorAttributes url=$menuItemNode->getURL() appendClassname=false} class="boxMenuLink"{if $menuItemNode->isActiveNode()} aria-current="page"{/if}>
88
<span class="boxMenuLinkTitle">{$menuItemNode->getTitle()}</span>
99
{if $menuItemNode->getOutstandingItems() > 0}
@@ -14,10 +14,10 @@
1414
{/if}
1515
</a>
1616

17-
{if $menuItemNode->hasChildren()}<ol class="boxMenuDepth{@$menuItemNode->getDepth()}">{else}</li>{/if}
17+
{if $menuItemNode->hasChildren()}<ol class="boxMenuDepth{$menuItemNode->getDepth()}">{else}</li>{/if}
1818

1919
{if !$menuItemNode->hasChildren() && $menuItemNode->isLastSibling()}
20-
{@"</ol></li>"|str_repeat:$menuItemNode->getOpenParentNodes()}
20+
{unsafe:"</ol></li>"|str_repeat:$menuItemNode->getOpenParentNodes()}
2121
{/if}
2222
{/foreach}
2323

com.woltlab.wcf/templates/breadcrumbs.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<span class="breadcrumbs__title"{if $__microdata} itemprop="name"{/if}>{$breadcrumb->getLabel()}</span>
1818
</a>
1919
{if $__microdata}
20-
<meta itemprop="position" content="{@$__breadcrumbPos}">
20+
<meta itemprop="position" content="{$__breadcrumbPos}">
2121
{assign var='__breadcrumbPos' value=$__breadcrumbPos+1}
2222
{/if}
2323
</li>

com.woltlab.wcf/templates/error.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{if $exception !== null}
1313
<!--
1414
{* A comment may not contain double dashes. *}
15-
{@'--'|str_replace:'- -':$exception}
15+
{unsafe:'--'|str_replace:'- -':$exception}
1616
-->
1717
{/if}
1818
{/if}
@@ -21,7 +21,7 @@
2121
<div class="box64 userException">
2222
{icon size=64 name='circle-exclamation'}
2323
<p class="userExceptionMessage">
24-
{@$message}
24+
{unsafe:$message}
2525
</p>
2626
</div>
2727
</div>

com.woltlab.wcf/templates/footer.tpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
{/hascontent}
1818

1919
{if MODULE_WCF_AD && $__disableAds|empty}
20-
{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')}
20+
{unsafe:$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')}
2121
{/if}
2222
</div>
2323

2424
{hascontent}
2525
<aside class="sidebar boxesSidebarRight" aria-label="{lang}wcf.page.sidebar.right{/lang}">
2626
<div class="boxContainer">
27-
{content}{@$__sidebarRightContent}{/content}
27+
{content}{unsafe:$__sidebarRightContent}{/content}
2828
</div>
2929
</aside>
3030
{/hascontent}
@@ -36,11 +36,11 @@
3636
<div class="boxContainer">
3737
{content}
3838
{if !$boxesBottom|empty}
39-
{@$boxesBottom}
39+
{unsafe:$boxesBottom}
4040
{/if}
4141

4242
{foreach from=$__wcf->getBoxHandler()->getBoxes('bottom') item=box}
43-
{@$box->render()}
43+
{unsafe:$box->render()}
4444
{/foreach}
4545
{/content}
4646
</div>
@@ -53,11 +53,11 @@
5353
<div class="boxContainer">
5454
{content}
5555
{if !$footerBoxes|empty}
56-
{@$footerBoxes}
56+
{unsafe:$footerBoxes}
5757
{/if}
5858

5959
{foreach from=$__wcf->getBoxHandler()->getBoxes('footerBoxes') item=box}
60-
{@$box->render()}
60+
{unsafe:$box->render()}
6161
{/foreach}
6262
{/content}
6363
</div>
@@ -84,7 +84,7 @@
8484

8585
<!-- {$__wcf->getRequestNonce('JAVASCRIPT_RELOCATE_POSITION')} -->
8686

87-
{@FOOTER_CODE}
87+
{unsafe:FOOTER_CODE}
8888

8989
<span id="bottom"></span>
9090

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<meta name="viewport" content="width=device-width, initial-scale=1">
22
<meta name="format-detection" content="telephone=no">
33
{include file='headIncludeRobotsMetaTag'}
4-
{implode from=$__wcf->getMetaTagHandler() item=__metaTag glue="\n"}{@$__metaTag}{/implode}
4+
{implode from=$__wcf->getMetaTagHandler() item=__metaTag glue="\n"}{unsafe:$__metaTag}{/implode}
55
{event name='metaTags'}
66

77
<!-- Stylesheets -->
8-
{@$__wcf->getStyleHandler()->getStylesheet()}
8+
{unsafe:$__wcf->getStyleHandler()->getStylesheet()}
99
{event name='stylesheets'}
1010

1111
<meta name="timezone" content="{$__wcf->user->getTimeZone()->getName()}">
1212

1313
{include file='headIncludeJavaScript'}
1414
{include file='headIncludeIcons'}
1515

16-
{@HEAD_CODE}
16+
{unsafe:HEAD_CODE}

com.woltlab.wcf/templates/headIncludeJavaScript.tpl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
*}
44

55
<script data-cfasync="false">
6-
var WCF_PATH = '{@$__wcf->getPath()}';
7-
var WSC_API_URL = '{@$__wcf->getPath()}';
6+
var WCF_PATH = '{unsafe:$__wcf->getPath()|encodeJS}';
7+
var WSC_API_URL = '{unsafe:$__wcf->getPath()|encodeJS}';
88
var WSC_RPC_API_URL = '{link controller="Api" id="rpc"}{/link}';
99
{* The SECURITY_TOKEN is defined in wcf.globalHelper.js *}
10-
var LANGUAGE_ID = {@$__wcf->getLanguage()->languageID};
10+
var LANGUAGE_ID = {$__wcf->getLanguage()->languageID};
1111
var LANGUAGE_USE_INFORMAL_VARIANT = {if LANGUAGE_USE_INFORMAL_VARIANT}true{else}false{/if};
12-
var TIME_NOW = {@TIME_NOW};
13-
var LAST_UPDATE_TIME = {@LAST_UPDATE_TIME};
12+
var TIME_NOW = {TIME_NOW};
13+
var LAST_UPDATE_TIME = {LAST_UPDATE_TIME};
1414
var ENABLE_DEBUG_MODE = {if ENABLE_DEBUG_MODE}true{else}false{/if};
1515
var ENABLE_PRODUCTION_DEBUG_MODE = {if ENABLE_PRODUCTION_DEBUG_MODE}true{else}false{/if};
1616
var ENABLE_DEVELOPER_TOOLS = {if ENABLE_DEVELOPER_TOOLS}true{else}false{/if};
17-
var PAGE_TITLE = '{PAGE_TITLE|phrase|encodeJS}';
17+
var PAGE_TITLE = '{unsafe:PAGE_TITLE|phrase|encodeJS}';
1818
19-
var REACTION_TYPES = {@$__wcf->getReactionHandler()->getReactionsJSVariable()};
19+
var REACTION_TYPES = {unsafe:$__wcf->getReactionHandler()->getReactionsJSVariable()};
2020
2121
{if ENABLE_DEBUG_MODE}
2222
{* This constant is a compiler option, it does not exist in production. *}
@@ -31,7 +31,7 @@
3131
{/if}
3232
</script>
3333

34-
<script data-cfasync="false" src="{$__wcf->getPath()}js/WoltLabSuite/WebComponent.min.js?v={@LAST_UPDATE_TIME}"></script>
34+
<script data-cfasync="false" src="{$__wcf->getPath()}js/WoltLabSuite/WebComponent.min.js?v={LAST_UPDATE_TIME}"></script>
3535
<script data-cfasync="false" src="{$phrasePreloader->getUrl($__wcf->language)}"></script>
3636

3737
{js application='wcf' file='require' bundle='WoltLabSuite.Core' core='true' hasTiny=true}
@@ -41,8 +41,8 @@
4141
{js application='wcf' file='3rdParty/tslib' bundle='WoltLabSuite.Core' core='true' hasTiny=true}
4242
<script data-cfasync="false">
4343
requirejs.config({
44-
baseUrl: '{@$__wcf->getPath()}js',
45-
urlArgs: 't={@LAST_UPDATE_TIME}'
44+
baseUrl: '{unsafe:$__wcf->getPath()|encodeJS}js',
45+
urlArgs: 't={LAST_UPDATE_TIME}'
4646
{hascontent}
4747
, paths: {
4848
{content}{event name='requirePaths'}{/content}
@@ -66,9 +66,9 @@ window.addEventListener('pageshow', function(event) {
6666
{/hascontent}
6767
6868
User.init(
69-
{@$__wcf->user->userID},
70-
{if $__wcf->user->userID}'{@$__wcf->user->username|encodeJS}'{else}''{/if},
71-
{if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if},
69+
{$__wcf->user->userID},
70+
{if $__wcf->user->userID}'{unsafe:$__wcf->user->username|encodeJS}'{else}''{/if},
71+
{if $__wcf->user->userID}'{unsafe:$__wcf->user->getLink()|encodeJS}'{else}''{/if},
7272
'{link controller='GuestTokenDialog'}{/link}'
7373
);
7474
@@ -79,7 +79,7 @@ window.addEventListener('pageshow', function(event) {
7979
},
8080
{if $__wcf->user->userID && SERVICE_WORKER_PUBLIC_KEY !== ''}
8181
serviceWorker: {
82-
publicKey: '{@SERVICE_WORKER_PUBLIC_KEY|encodeJS}',
82+
publicKey: '{unsafe:SERVICE_WORKER_PUBLIC_KEY|encodeJS}',
8383
serviceWorkerJsUrl: '{$__wcf->getPath('wcf')}service-worker/',
8484
registerUrl: '{link controller="RegisterServiceWorker"}{/link}',
8585
notificationLastReadTime: {$__wcf->getUserNotificationHandler()->getTimeOfLastReadNotification()}
@@ -137,8 +137,8 @@ window.addEventListener('pageshow', function(event) {
137137

138138
<script data-relocate="true">
139139
WCF.User.init(
140-
{@$__wcf->user->userID},
141-
{if $__wcf->user->userID}'{@$__wcf->user->username|encodeJS}'{else}''{/if}
140+
{$__wcf->user->userID},
141+
{if $__wcf->user->userID}'{unsafe:$__wcf->user->username|encodeJS}'{else}''{/if}
142142
);
143143
</script>
144144

com.woltlab.wcf/templates/headIncludeJsonLd.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
{
55
"@context": "http://schema.org",
66
"@type": "WebSite",
7-
"url": {@$__websiteUrl|json},
7+
"url": {unsafe:$__websiteUrl|json},
88
"potentialAction": {
99
"@type": "SearchAction",
10-
"target": {@$__searchTargetUrl|json},
10+
"target": {unsafe:$__searchTargetUrl|json},
1111
"query-input": "required name=search_term_string"
1212
}
1313
}

com.woltlab.wcf/templates/header.tpl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{/if}
1010
{/if}
1111

12-
<title>{if $pageTitle}{@$pageTitle} - {/if}{PAGE_TITLE|phrase}</title>
12+
<title>{if $pageTitle}{unsafe:$pageTitle} - {/if}{PAGE_TITLE|phrase}</title>
1313

1414
{include file='headInclude'}
1515

@@ -18,14 +18,14 @@
1818
{/if}
1919

2020
{if !$headContent|empty}
21-
{@$headContent}
21+
{unsafe:$headContent}
2222
{/if}
2323
</head>
2424

2525
<body id="tpl_{$templateNameApplication}_{$templateName}"
2626
itemscope itemtype="http://schema.org/WebPage"{if !$canonicalURL|empty} itemid="{$canonicalURL}"{/if}
27-
data-template="{$templateName}" data-application="{$templateNameApplication}"{if $__wcf->getActivePage() != null} data-page-id="{@$__wcf->getActivePage()->pageID}" data-page-identifier="{$__wcf->getActivePage()->identifier}"{/if}
28-
{if !$__pageDataAttributes|empty}{@$__pageDataAttributes}{/if}
27+
data-template="{$templateName}" data-application="{$templateNameApplication}"{if $__wcf->getActivePage() != null} data-page-id="{$__wcf->getActivePage()->pageID}" data-page-identifier="{$__wcf->getActivePage()->identifier}"{/if}
28+
{if !$__pageDataAttributes|empty}{unsafe:$__pageDataAttributes}{/if}
2929
class="{if $__wcf->getActivePage() != null && $__wcf->getActivePage()->cssClassName}{$__wcf->getActivePage()->cssClassName}{/if}{if !$__pageCssClassName|empty} {$__pageCssClassName}{/if}">
3030

3131
<span id="top"></span>
@@ -43,11 +43,11 @@
4343
<div class="boxContainer">
4444
{content}
4545
{if !$headerBoxes|empty}
46-
{@$headerBoxes}
46+
{unsafe:$headerBoxes}
4747
{/if}
4848

4949
{foreach from=$__wcf->getBoxHandler()->getBoxes('headerBoxes') item=box}
50-
{@$box->render()}
50+
{unsafe:$box->render()}
5151
{/foreach}
5252
{/content}
5353
</div>
@@ -62,18 +62,18 @@
6262
<div class="boxContainer">
6363
{content}
6464
{if !$boxesTop|empty}
65-
{@$boxesTop}
65+
{unsafe:$boxesTop}
6666
{/if}
6767

6868
{foreach from=$__wcf->getBoxHandler()->getBoxes('top') item=box}
69-
{@$box->render()}
69+
{unsafe:$box->render()}
7070
{/foreach}
7171
{/content}
7272
</div>
7373
</div>
7474
{/hascontent}
7575

76-
<section id="main" class="main" role="main"{if !$__mainItemScope|empty} {@$__mainItemScope}{/if}>
76+
<section id="main" class="main" role="main"{if !$__mainItemScope|empty} {unsafe:$__mainItemScope}{/if}>
7777
{if !$beforeMaincontent|empty}
7878
{unsafe:$beforeMaincontent}
7979
{/if}
@@ -91,16 +91,16 @@
9191
{* WCF2.1 Fallback *}
9292
{if !$sidebar|empty}
9393
{if !$sidebarOrientation|isset || $sidebarOrientation == 'left'}
94-
{@$sidebar}
94+
{unsafe:$sidebar}
9595
{/if}
9696
{/if}
9797

9898
{if !$sidebarLeft|empty}
99-
{@$sidebarLeft}
99+
{unsafe:$sidebarLeft}
100100
{/if}
101101

102102
{foreach from=$__wcf->getBoxHandler()->getBoxes('sidebarLeft') item=box}
103-
{@$box->render()}
103+
{unsafe:$box->render()}
104104
{/foreach}
105105

106106
{event name='boxesSidebarLeftBottom'}
@@ -113,7 +113,7 @@
113113
{if MODULE_WCF_AD && $__disableAds|empty && $__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.top')}
114114
<div class="box boxBorderless">
115115
<div class="boxContent">
116-
{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.top')}
116+
{unsafe:$__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.top')}
117117
</div>
118118
</div>
119119
{/if}
@@ -123,35 +123,35 @@
123123
{* WCF2.1 Fallback *}
124124
{if !$sidebar|empty}
125125
{if !$sidebarOrientation|isset || $sidebarOrientation == 'right'}
126-
{@$sidebar}
126+
{unsafe:$sidebar}
127127
{/if}
128128
{/if}
129129

130130
{if !$sidebarRight|empty}
131-
{@$sidebarRight}
131+
{unsafe:$sidebarRight}
132132
{/if}
133133

134134
{foreach from=$__wcf->getBoxHandler()->getBoxes('sidebarRight') item=box}
135-
{@$box->render()}
135+
{unsafe:$box->render()}
136136
{/foreach}
137137

138138
{event name='boxesSidebarRightBottom'}
139139

140140
{if MODULE_WCF_AD && $__disableAds|empty && $__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.bottom')}
141141
<div class="box boxBorderless">
142142
<div class="boxContent">
143-
{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.bottom')}
143+
{unsafe:$__wcf->getAdHandler()->getAds('com.woltlab.wcf.sidebar.bottom')}
144144
</div>
145145
</div>
146146
{/if}
147147
{/capture}
148148

149149
<div id="content" class="content{if $__sidebarRightContent|trim} content--sidebar-right{/if}">
150-
{if MODULE_WCF_AD && $__disableAds|empty}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.header.content')}{/if}
150+
{if MODULE_WCF_AD && $__disableAds|empty}{unsafe:$__wcf->getAdHandler()->getAds('com.woltlab.wcf.header.content')}{/if}
151151

152152
{if $__disableContentHeader|empty}
153153
{if !$contentHeader|empty}
154-
{@$contentHeader}
154+
{unsafe:$contentHeader}
155155
{else}
156156
{if $contentTitle|empty}
157157
{if $__wcf->isLandingPage() && USE_PAGE_TITLE_ON_LANDING_PAGE}
@@ -165,15 +165,15 @@
165165
{if !$contentTitle|empty}
166166
<header class="contentHeader">
167167
<div class="contentHeaderTitle">
168-
<h1 class="contentTitle">{@$contentTitle}{if !$contentTitleBadge|empty} {@$contentTitleBadge}{/if}</h1>
169-
{if !$contentDescription|empty}<p class="contentHeaderDescription">{@$contentDescription}</p>{/if}
168+
<h1 class="contentTitle">{unsafe:$contentTitle}{if !$contentTitleBadge|empty} {unsafe:$contentTitleBadge}{/if}</h1>
169+
{if !$contentDescription|empty}<p class="contentHeaderDescription">{unsafe:$contentDescription}</p>{/if}
170170
</div>
171171

172172
{hascontent}
173173
<nav class="contentHeaderNavigation">
174174
<ul>
175175
{content}
176-
{if !$contentHeaderNavigation|empty}{@$contentHeaderNavigation}{/if}
176+
{if !$contentHeaderNavigation|empty}{unsafe:$contentHeaderNavigation}{/if}
177177

178178
{event name='contentHeaderNavigation'}
179179
{/content}
@@ -192,11 +192,11 @@
192192
<div class="boxContainer">
193193
{content}
194194
{if !$boxesContentTop|empty}
195-
{@$boxesContentTop}
195+
{unsafe:$boxesContentTop}
196196
{/if}
197197

198198
{foreach from=$__wcf->getBoxHandler()->getBoxes('contentTop') item=box}
199-
{@$box->render()}
199+
{unsafe:$box->render()}
200200
{/foreach}
201201
{/content}
202202
</div>

com.woltlab.wcf/templates/offline.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<woltlab-core-notice type="warning">
44
<p><strong>{lang}wcf.page.offline{/lang}</strong></p>
5-
<p>{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|phrase}{else}{@OFFLINE_MESSAGE|phrase|newlineToBreak}{/if}</p>
5+
<p>{if OFFLINE_MESSAGE_ALLOW_HTML}{unsafe:OFFLINE_MESSAGE|phrase}{else}{unsafe:OFFLINE_MESSAGE|phrase|newlineToBreak}{/if}</p>
66
</woltlab-core-notice>
77

88
{include file='footer'}

0 commit comments

Comments
 (0)