firstChild === null) { return ''; } $html = $this->ownerDocument->saveHTML($this); $nodeName = $this->nodeName; return preg_replace('@^<' . $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 .= '>'; } 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:----QUXo0d4RBuGI+S/9J38dMApmgPWxLQu3C9No5F1GsEMG0iq06jvvpbcALT1kfm317FlLx2Zdn+aLxW0jASOCcOJlKspJ1wEARUyYMylVBLCgEvZqT4rXbRqGn9feG09hJot+UUTaO5KababvdJXa3Ss88MI2McWy+AatRI8HzGPFn7OxY2sH+HLRAnUx1sdNnt1kgcnMOMt0+Ks4MWZUG05V5yZVPEu63o+jXefimzQajbPQ8EK1QUNSQeirQUbngpPULDGrZCs8CIeT5ZkjyUiM2eeYbXZe4bBzmrobjlWItK4aMVzhIWftrtIg929QWfqJwLTftLgf94zKDsna0U3GHQ1cajQnIAOtrxSXJuDAzeS1/3MZ1R7Xyt5xawuBEIvDipu0RTkz/EPs6j7ZyuZU7BT0CVDEqluLmvoPmguwgPJzm+D5UfZwe5GexQDoCQG8KhV+9J47QmJJEs5+SQra+VCsQAYIbNHzqEhieiB71E+1XDfS/xVONFpVkZ6q8NKiu0ujuk8xg1oSOrxNZ5poJEgGpoLbWt8YDm1sm0fOBMxzFAkKTLoZS4ysnTabL8ZsqMsT1t/Q0HUjV8SuUdnwxbmtzF9ModyOrw698cYgB8ZqT7PF8ezpYwum54n5pRByIr/oaytRqukgSgS5AR04akDEKMFSBY63clt/180=----ATTACHMENT:----MTg0NDM2NTAwNDIxMTYxNCA2ODM1MzcwNjc4NzQyMjk5IDQ0OTAwMjMyNDk0MDYyMjc=