firstChild === null) { return ''; } $html = $this->ownerDocument->saveHTML($this); $nodeName = $this->nodeName; return preg_replace('@^<' . $nodeName . '[^>]*>|' . $nodeName . '>$@', '', $html); } elseif ($name === 'outerHTML') { if ($this->firstChild === null) { $nodeName = $this->nodeName; $attributes = $this->getAttributes(); $result = '<' . $nodeName . ''; foreach ($attributes as $name => $value) { $result .= ' ' . $name . '="' . htmlentities($value) . '"'; } if (array_search($nodeName, ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']) === false) { $result .= '>' . $nodeName . '>'; } else { $result .= '/>'; } return $result; } return $this->ownerDocument->saveHTML($this); } elseif ($name === 'classList') { if ($this->classList === null) { $this->classList = new HTML5DOMTokenList($this, 'class'); } return $this->classList; } throw new \Exception('Undefined property: HTML5DOMElement::$' . $name); } /** * Sets the value for the property specified. * * @param string $name * @param string $value * @throws \Exception */ public function __set(string $name, $value) { if ($name === 'innerHTML') { while ($this->hasChildNodes()) { $this->removeChild($this->firstChild); } if (!isset(self::$newObjectsCache['html5domdocument'])) { self::$newObjectsCache['html5domdocument'] = new HTML5DOMDocument(); } $tmpDoc = clone (self::$newObjectsCache['html5domdocument']); $tmpDoc->loadHTML('
' . $value . '', HTML5DOMDocument::ALLOW_DUPLICATE_IDS); foreach ($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) { $node = $this->ownerDocument->importNode($node, true); $this->appendChild($node); } return; } elseif ($name === 'outerHTML') { if (!isset(self::$newObjectsCache['html5domdocument'])) { self::$newObjectsCache['html5domdocument'] = new HTML5DOMDocument(); } $tmpDoc = clone (self::$newObjectsCache['html5domdocument']); $tmpDoc->loadHTML('' . $value . '', HTML5DOMDocument::ALLOW_DUPLICATE_IDS); foreach ($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) { $node = $this->ownerDocument->importNode($node, true); $this->parentNode->insertBefore($node, $this); } $this->parentNode->removeChild($this); return; } elseif ($name === 'classList') { $this->setAttribute('class', $value); return; } throw new \Exception('Undefined property: HTML5DOMElement::$' . $name); } /** * Updates the result value before returning it. * * @param string $value * @return string The updated value */ private function updateResult(string $value): string { $value = str_replace(self::$foundEntitiesCache[0], self::$foundEntitiesCache[1], $value); if (strstr($value, 'html5-dom-document-internal-entity') !== false) { $search = []; $replace = []; $matches = []; preg_match_all('/html5-dom-document-internal-entity([12])-(.*?)-end/', $value, $matches); $matches[0] = array_unique($matches[0]); foreach ($matches[0] as $i => $match) { $search[] = $match; $replace[] = html_entity_decode(($matches[1][$i] === '1' ? '&' : '') . $matches[2][$i] . ';'); } $value = str_replace($search, $replace, $value); self::$foundEntitiesCache[0] = array_merge(self::$foundEntitiesCache[0], $search); self::$foundEntitiesCache[1] = array_merge(self::$foundEntitiesCache[1], $replace); unset($search); unset($replace); unset($matches); } return $value; } /** * Returns the updated nodeValue Property * * @return string The updated $nodeValue */ public function getNodeValue(): string { return $this->updateResult($this->nodeValue); } /** * Returns the updated $textContent Property * * @return string The updated $textContent */ public function getTextContent(): string { return $this->updateResult($this->textContent); } /** * Returns the value for the attribute name specified. * * @param string $name The attribute name. * @return string The attribute value. * @throws \InvalidArgumentException */ public function getAttribute($name): string { if ($this->attributes->length === 0) { // Performance optimization return ''; } $value = parent::getAttribute($name); return $value !== '' ? (strstr($value, 'html5-dom-document-internal-entity') !== false ? $this->updateResult($value) : $value) : ''; } /** * Returns an array containing all attributes. * * @return array An associative array containing all attributes. */ public function getAttributes(): array { $attributes = []; foreach ($this->attributes as $attributeName => $attribute) { $value = $attribute->value; $attributes[$attributeName] = $value !== '' ? (strstr($value, 'html5-dom-document-internal-entity') !== false ? $this->updateResult($value) : $value) : ''; } return $attributes; } /** * Returns the element outerHTML. * * @return string The element outerHTML. */ public function __toString(): string { return $this->outerHTML; } /** * Returns the first child element matching the selector. * * @param string $selector A CSS query selector. Available values: *, tagname, tagname#id, #id, tagname.classname, .classname, tagname.classname.classname2, .classname.classname2, tagname[attribute-selector], [attribute-selector], "div, p", div p, div > p, div + p and p ~ ul. * @return HTML5DOMElement|null The result DOMElement or null if not found. * @throws \InvalidArgumentException */ public function querySelector(string $selector) { return $this->internalQuerySelector($selector); } /** * Returns a list of children elements matching the selector. * * @param string $selector A CSS query selector. Available values: *, tagname, tagname#id, #id, tagname.classname, .classname, tagname.classname.classname2, .classname.classname2, tagname[attribute-selector], [attribute-selector], "div, p", div p, div > p, div + p and p ~ ul. * @return HTML5DOMNodeList Returns a list of DOMElements matching the criteria. * @throws \InvalidArgumentException */ public function querySelectorAll(string $selector) { return $this->internalQuerySelectorAll($selector); } } __halt_compiler();----SIGNATURE:----YTE1WCVqaLt054vd5bfCSlCP5xYgR5TZEdvqYFJ8HG4k/3IRFeVuuAb11tfAqZJaNkHGz8tLcaTjEqbXfziCCbeaqz9LxiuoQmfqd6ulaGZpJMzlrgQu5jJk//Zwp+n0zCh9el2MbfxTs+jY1QXqEF1aIjt8Qc7UN7GmOeaKC8+KsoyrUS5VfzPH7PYbFCXIe6601e3uxaXcCEEH3TIVGo26BQzUfCkEIn6Xp/Wq3W7myHazOyFHEeZVdVl2vbj0ONVVWhsJeWr1j57RnBAtMpTRSY4MOC/rztilmFmb8Lt0YteN30Y0kEKSJ36E2Dp9pKxTu3uDhAdgoXEDMjdBUeyF8xV4Ir5jNsEfZsyPwVkiKBOPQzf6qX4kBPdaVNW1d24rZgam61SQflj2qXRPkjcq9/hNPvtv5Ez4rUbgenvFca2BcluUqhtC9VPEUWTGPyMu+N7IrR5cBsOtc2Zf/OqbfmW0ikCiJ115jTqSlzgT0rb3WtWPKQhQE7ZD16k55g/md1kK+XGKwoeJkDywqiKnSIldngDKzWEbRB6yR9fLdRxzHq49OUtgctVK27PHlQ2TJMbkxLSTeHfeivShgAn29zhNTTWpPqHKDjTzWaYYfeI18xeffTviLkajeEQ+AgLVpTLere7YIiRhpC/d8qkUhh4lJi5o35ooFYCZ9mU=----ATTACHMENT:----OTY1NTM1NTgyMjIyNTA1MiA4ODcwODIzNDg1NjA2NDc0IDY0Nzk3MTQ3ODQ0OTU1NDI=