protected function isScripted($html)
{
if (preg_match('/<script[^>]*>.*?<\\/script>/is', $html)) {
return true;
}
try {
$doc = new \DOMDocument();
$doc->loadHTML($html);
foreach ($doc->getElementsByTagname('*') as $element) {
foreach (iterator_to_array($element->attributes) as $name => $attribute) {
if (in_array($name, $this->javaScriptEvents)) {
return true;
}
}
}
} catch (\Exception $e) {
error_log($e);
}
return false;
}