You are here

function _cookie_content_blocker_replace_scripts_with_fake in Cookie Content Blocker 7

Replace scripts in HTML with a placeholder fake script tag.

We need a fake script tag to not break the outer <script> tag with type 'text/plain'. It essentially provides us with the posibility to store the original content inline without the browser evaluating it.

Parameters

string $html: The original HTML.

Return value

string The HTML with replaced scripts.

See also

cookie-content-blocker-wrapper.tpl.php

1 call to _cookie_content_blocker_replace_scripts_with_fake()
cookie_content_blocker_preprocess_cookie_content_blocker_wrapper in ./cookie_content_blocker.module
Implements hook_preprocess_HOOK() for cookie_content_blocker_wrapper().

File

./cookie_content_blocker.module, line 369
Contains the main module code for Cookie content blocker.

Code

function _cookie_content_blocker_replace_scripts_with_fake($html) {
  return preg_replace('/(<[\\/]?script)/', "\$1fake", $html);
}