1 <?php declare(strict_types=1);
25 public function isValid() :
bool 27 if (!preg_match(
'/<[^>]+?>/', $this->text)) {
32 $dom =
new DOMDocument();
33 if (!$dom->loadHTML($this->text)) {
39 RecursiveIteratorIterator::SELF_FIRST
41 foreach ($iter as $element) {
43 if (in_array(strtolower($element->nodeName), [
'body'])) {
47 if ($element->nodeType === XML_ELEMENT_NODE) {
55 }
catch (Throwable $e) {
Class ilTermsOfServiceDocumentsContainsHtmlValidator.
__construct(string $text)
ilTermsOfServiceDocumentsContainsHtmlValidator constructor.
Class ilHtmlDomNodeIterator.