From e499f034bfe30e26dc5142de3e778b1acf41de82 Mon Sep 17 00:00:00 2001 From: Bhanudas Hegaje Date: Thu, 19 Dec 2024 22:32:08 +0530 Subject: [PATCH] Bugfix remove query string inclusion in body class generation logic (#6547) Co-authored-by: Steve Piercy --- packages/volto/news/6493.bugfix | 1 + packages/volto/src/components/theme/App/App.jsx | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 packages/volto/news/6493.bugfix diff --git a/packages/volto/news/6493.bugfix b/packages/volto/news/6493.bugfix new file mode 100644 index 0000000000..a5e5c9aad3 --- /dev/null +++ b/packages/volto/news/6493.bugfix @@ -0,0 +1 @@ +No longer add classes from the query string search text in the `body` tag. @Abhishek-17h \ No newline at end of file diff --git a/packages/volto/src/components/theme/App/App.jsx b/packages/volto/src/components/theme/App/App.jsx index 1c900fefe1..cda1be4085 100644 --- a/packages/volto/src/components/theme/App/App.jsx +++ b/packages/volto/src/components/theme/App/App.jsx @@ -146,10 +146,13 @@ export class App extends Component { this.props.pathname !== '/', siteroot: this.props.pathname === '/', [`is-adding-contenttype-${decodeURIComponent( - this.props.location?.search?.replace('?type=', ''), + this.props.location?.search?.startsWith('?type=') + ? this.props.location?.search?.replace('?type=', '') + : '', ) .replaceAll(' ', '-') - .toLowerCase()}`]: this.props.location?.search, + .toLowerCase()}`]: + this.props.location?.search?.startsWith('?type='), 'is-authenticated': !!this.props.token, 'is-anonymous': !this.props.token, 'cms-ui': isCmsUI,