Browse Source

ignore errors when parsing HTML

main
Aaron Parecki 8 years ago
parent
commit
a5fee11a34
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      controllers/API.php

+ 2
- 0
controllers/API.php View File

@ -112,7 +112,9 @@ class API {
$sourceData = $this->http->get($source);
$doc = new DOMDocument();
libxml_use_internal_errors(true); # suppress parse errors and warnings
@$doc->loadHTML(self::toHtmlEntities($sourceData['body']), LIBXML_NOWARNING|LIBXML_NOERROR);
libxml_clear_errors();
if(!$doc) {
return $this->respond($response, 400, [

Loading…
Cancel
Save