Skip to content

Commit

Permalink
Bugfix remove query string inclusion in body class generation logic (#…
Browse files Browse the repository at this point in the history
…6547)

Co-authored-by: Steve Piercy <[email protected]>
  • Loading branch information
Abhishek-17h and stevepiercy authored Dec 19, 2024
1 parent 928afbd commit e499f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/6493.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No longer add classes from the query string search text in the `body` tag. @Abhishek-17h
7 changes: 5 additions & 2 deletions packages/volto/src/components/theme/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e499f03

Please sign in to comment.