- Affected version
- 2.2.4
Code:
jquery-3.5.1.min.js?_v=864c504b:formatted:1505 Uncaught TypeError: a.replace is not a function
at Object.appBadgeUpdate (core-compiled.js?_v=864c504b:formatted:1117)
at Object.updateVisitorCounts (core-compiled.js?_v=864c504b:formatted:1038)
at Object.updateVisitorCountsOnLoad (core-compiled.js?_v=864c504b:formatted:1053)
at HTMLDocument.onPageLoad (core-compiled.js?_v=864c504b:formatted:924)
at e (jquery-3.5.1.min.js?_v=864c504b:formatted:1423)
at t (jquery-3.5.1.min.js?_v=864c504b:formatted:1434)
This seems to be caused by
Code:
newCount = parseInt(newCount.replace(/[,. ]/g, ''));
XF.appBadgeUpdate()
.This does assume that
newCount
is a string, but this might not necessarily be the case - on initial page load this is XF.visitorCounts.total_unread which is an integer:
Code:
$.extend(XF, {
config: {
userId: null,
enablePush: false,
skipServiceWorkerRegistration: false,
skipPushNotificationSubscription: false,
skipPushNotificationCta: false,
pushAppServerKey: null,
csrf: $('html').data('csrf'),
time: {
now: 0,
today: 0,
todayDow: 0,
tomorrow: 0,
yesterday: 0,
week: 0
},
cookie: {
path: '/',
domain: '',
prefix: 'xf_'
},
url: {
fullBase: '/',
basePath: '/',
css: '',
keepAlive: ''
},
css: {},
js: {},
jsState: {},
speed: {
xxfast: 50,
xfast: 100,
fast: 200,
normal: 400,
slow: 600
},
job: {
manualUrl: ''
},
borderSizeFeature: '3px',
fontAwesomeWeight: 'r',
enableRtnProtect: true,
enableFormSubmitSticky: true,
visitorCounts: {
conversations_unread: 0,
alerts_unviewed: 0,
total_unread: 0,
title_count: false,
icon_indicator: false
},