Skip to content

Commit fe329da

Browse files
committed
Fix warning on PHP 5.6 about static calling of DOMDocument::loadHTMLFile()
1 parent e070e67 commit fe329da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bashquote

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ class BashOrgQuotes extends Quotes {
101101
*/
102102
function fetchQuotes() {
103103
libxml_use_internal_errors(TRUE);
104-
$doc = DOMDocument::loadHTMLFile("http://bash.org/?random1");
104+
$doc = new DOMDocument;
105+
$doc->loadHTMLFile("http://bash.org/?random1");
105106
$xpath = new DOMXPath($doc);
106-
$elements = $xpath->query('//p[@class="qt"]');
107+
$elements = $xpath->query('//p[@class="qt"]');
107108
$quotes = array();
108109
foreach ($elements as $element) {
109110
$quote = $element->textContent;

0 commit comments

Comments
 (0)