From 64884285411875bd2e47ee0000c60308dd4b1386 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 31 Oct 2010 13:08:29 +0000 Subject: - Patch #951774 by Damien Tournoud: DOMDocument::loadHTML() should not be called statically. --- modules/filter/filter.module | 3 ++- modules/simpletest/drupal_web_test_case.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 277363731..8834bead9 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -1037,8 +1037,9 @@ function _filter_tips($format_id, $long = FALSE) { * A DOMDocument that represents the loaded (X)HTML snippet. */ function filter_dom_load($text) { + $dom_document = new DOMDocument(); // Ignore warnings during HTML soup loading. - $dom_document = @DOMDocument::loadHTML('' . $text . ''); + @$dom_document->loadHTML('' . $text . ''); return $dom_document; } diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 6ec5e6552..534affd70 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1585,7 +1585,8 @@ class DrupalWebTestCase extends DrupalTestCase { if (!$this->elements) { // DOM can load HTML soup. But, HTML soup can throw warnings, suppress // them. - @$htmlDom = DOMDocument::loadHTML($this->drupalGetContent()); + $htmlDom = new DOMDocument(); + @$htmlDom->loadHTML($this->drupalGetContent()); if ($htmlDom) { $this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser')); // It's much easier to work with simplexml than DOM, luckily enough @@ -1857,7 +1858,8 @@ class DrupalWebTestCase extends DrupalTestCase { ); // DOM can load HTML soup. But, HTML soup can throw warnings, suppress // them. - @$dom = DOMDocument::loadHTML($content); + $dom = new DOMDocument(); + @$dom->loadHTML($content); foreach ($return as $command) { switch ($command['command']) { case 'settings': -- cgit v1.2.3