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