Multiple html lines of seckitGetJsCssNoscriptCode function create issue when js aggregate and minify html is on

Created on 11 September 2024, 3 months ago

Problem/Motivation

Seckit Modules ClickJacking settings creates Unexpected token error in console.log

Steps to reproduce

Precondition
- JS aggregation is "On" (admin/config/development/performance)
- Minify html, Purify html or any other kind of html purify setting is on
- Enables JavaScript + CSS + Noscript setting is "On" in Seckit module.

Error:
- Unexpected token error will occur and breaks further JavaScript execution

Proposed resolution

Here is Updated Function to get rid of that error:

public function seckitJsCssNoscript() {
// @todo Consider batter solution?
$content = $this->response->getContent();
$head_close_position = strpos($content, '');
if ($head_close_position) {

$noscriptcontent = $this->seckitGetJsCssNoscriptCode();
$noscriptcontent = trim(preg_replace( '/\s+/', ' ', $noscriptcontent));

$content = substr_replace($content, $noscriptcontent, $head_close_position, 0);

$this->response->setContent($content);
}
}

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India hetalsagar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024