From: Tim Düsterhus Date: Tue, 21 Sep 2021 08:54:46 +0000 (+0200) Subject: Do not pass `null` to `|encodeJS` X-Git-Tag: 5.4.8_dev_1~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d12c9783ce32b0396a80a498f54b053591d4aa3;p=GitHub%2FWoltLab%2FWCF.git Do not pass `null` to `|encodeJS` This breaks in PHP 8.1. --- diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index fe9b47518a..b0d0840e61 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -169,7 +169,7 @@ window.addEventListener('pageshow', function(event) { User.init( {@$__wcf->user->userID}, - '{@$__wcf->user->username|encodeJS}', + {if $__wcf->user->userID}'{@$__wcf->user->username|encodeJS}'{else}''{/if}, {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if} ); @@ -212,7 +212,10 @@ window.addEventListener('pageshow', function(event) { define.amd = __require_define_amd; $.holdReady(true); - WCF.User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}'); + WCF.User.init( + {@$__wcf->user->userID}, + {if $__wcf->user->userID}'{@$__wcf->user->username|encodeJS}'{else}''{/if} + ); {js application='wcf' file='WCF.Like' bundle='WCF.Combined' hasTiny=true}