We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a27cbd9 commit a4e3ebfCopy full SHA for a4e3ebf
src/Symfony/Component/DomCrawler/Crawler.php
@@ -499,7 +499,15 @@ public function html()
499
500
$html = '';
501
foreach ($this->getNode(0)->childNodes as $child) {
502
- $html .= $child->ownerDocument->saveHTML($child);
+ if (version_compare(PHP_VERSION, '5.3.6', '>=')) {
503
+ // node parameter was added to the saveHTML() method in PHP 5.3.6
504
+ // @see http://php.net/manual/en/domdocument.savehtml.php
505
+ $html .= $child->ownerDocument->saveHTML($child);
506
+ } else {
507
+ $document = new \DOMDocument('1.0', 'UTF-8');
508
+ $document->appendChild($document->importNode($child, true));
509
+ $html .= rtrim($document->saveHTML());
510
+ }
511
}
512
513
return $html;
0 commit comments