git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a1ab4d
)
Fix DOMDocument usage on PHP 8.2
author
Christian Weiske
<cweiske@cweiske.de>
Thu, 23 Mar 2023 19:31:53 +0000
(20:31 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Thu, 23 Mar 2023 19:31:53 +0000
(20:31 +0100)
src/phorkie/HtmlParser.php
patch
|
blob
|
history
diff --git
a/src/phorkie/HtmlParser.php
b/src/phorkie/HtmlParser.php
index 257dfe14e6f8a7bda71a5b2d3e384c4a515b8d4d..8102c69a42c6e45d4c79cefb4773dc7ff7926bb7 100644
(file)
--- a/
src/phorkie/HtmlParser.php
+++ b/
src/phorkie/HtmlParser.php
@@
-92,11
+92,13
@@
class HtmlParser
//$sx = simplexml_load_file($url);
libxml_use_internal_errors(true);
//$sx = simplexml_load_file($url);
libxml_use_internal_errors(true);
+ $domDoc = new \DOMDocument();
if ($html === null) {
if ($html === null) {
- $
sx = simplexml_import_dom(\DOMDocument::loadHTMLFile($url)
);
+ $
domDoc->loadHTMLFile($url
);
} else {
} else {
- $
sx = simplexml_import_dom(\DOMDocument::loadHTML($html)
);
+ $
domDoc->loadHTML($html
);
}
}
+ $sx = simplexml_import_dom($domDoc);
//FIXME: handle network error
$elems = $sx->xpath('//*[@rel="vcs-git"]');
//FIXME: handle network error
$elems = $sx->xpath('//*[@rel="vcs-git"]');