fix incomplete url for getting DOM
This commit is contained in:
1
inc/databap.php
Normal file → Executable file
1
inc/databap.php
Normal file → Executable file
@@ -691,6 +691,7 @@ class Databap extends PhpObject
|
|||||||
private function getRemotePageDom($sUrl)
|
private function getRemotePageDom($sUrl)
|
||||||
{
|
{
|
||||||
$oDom = new DOMDocument();
|
$oDom = new DOMDocument();
|
||||||
|
if(mb_substr($sUrl, 0, 4)!='http') $sUrl = 'http://'.$sUrl;
|
||||||
@$oDom->loadHTML(file_get_contents($sUrl));
|
@$oDom->loadHTML(file_get_contents($sUrl));
|
||||||
return $oDom->getElementsByTagName('body')->item(0);
|
return $oDom->getElementsByTagName('body')->item(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user