Merge pull request #1242 from annando/1412-stale-gprobe
Bugfix for stale gprobe.php
This commit is contained in:
commit
15d5e6cd45
|
@ -37,6 +37,8 @@ function gprobe_run(&$argv, &$argc){
|
|||
dbesc(normalise_link($url))
|
||||
);
|
||||
|
||||
logger("gprobe start for ".normalise_link($url), LOGGER_DEBUG);
|
||||
|
||||
if(! count($r)) {
|
||||
|
||||
$arr = probe_url($url);
|
||||
|
@ -56,6 +58,7 @@ function gprobe_run(&$argv, &$argc){
|
|||
if(count($r))
|
||||
poco_load(0,0,$r[0]['id'], str_replace('/profile/','/poco/',$r[0]['url']));
|
||||
|
||||
logger("gprobe end for ".normalise_link($url), LOGGER_DEBUG);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,12 @@ class HTML5_Parser
|
|||
* @return Parsed HTML as DOMDocument
|
||||
*/
|
||||
static public function parse($text, $builder = null) {
|
||||
|
||||
// Cleanup invalid HTML
|
||||
$doc = new DOMDocument();
|
||||
@$doc->loadHTML($text);
|
||||
$text = $doc->saveHTML();
|
||||
|
||||
$tokenizer = new HTML5_Tokenizer($text, $builder);
|
||||
$tokenizer->parse();
|
||||
return $tokenizer->save();
|
||||
|
|
Loading…
Reference in a new issue