Skip to content

Commit 9f1c926

Browse files
authored
Add files via upload
1 parent e03c08c commit 9f1c926

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

classes/DomDocumentParser.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ class DomDocumentParser
55

66
public function __construct($url)
77
{
8+
$html = '<?xml encoding="UTF-8">';
9+
810
$options = array(
911
'http'=>array('method'=>"GET", 'header'=>"User-Agent: doogleBot/0.1\n")
1012
);
1113
$context = stream_context_create($options);
14+
$getConstants = file_get_contents($url, false, $context);
1215

13-
$this->doc = new DomDocument();
14-
@$this->doc->loadHTML(file_get_contents($url, false, $context));
16+
$this->doc = new DomDocument('1.0', 'utf-8');
17+
@$this->doc->loadHTML($html . $getConstants);
1518
//@ Error supression is unnecessary, PHP>7.0 supports HTML5
1619
}
1720

0 commit comments

Comments
 (0)