Skip to content

Commit

Permalink
fix(core): 馃悰 incorrect delimiter in inline script
Browse files Browse the repository at this point in the history
Commas are not encoded in localStorage
  • Loading branch information
alistair3149 committed Apr 25, 2024
1 parent d24a8d6 commit 4aefd74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/skins.citizen.scripts/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ window.clientPrefs = () => {
const storage = localStorage.getItem( 'mwclientpreferences' );
if ( storage ) {
// TODO: Just use array for localStorage
storage.split( '%2C' ).forEach( function ( pref ) {
storage.split( ',' ).forEach( function ( pref ) {
console.log( pref );
className = className.replace(
// eslint-disable-next-line security/detect-non-literal-regexp
new RegExp( '(^| )' + pref.replace( /-clientpref-\w+$|[^\w-]+/g, '' ) + '-clientpref-\\w+( |$)' ),
Expand All @@ -85,6 +86,7 @@ window.clientPrefs = () => {
className += ` ${ LEGACY_PREFIX }${ matchedKey }`;
}
}
console.log( className );
} );
document.documentElement.className = className;
}
Expand Down

0 comments on commit 4aefd74

Please sign in to comment.