forked from GNUsocial/gnu-social
Suppress whinging during HTML parsing in profile page discovery for things that turn out to be XML feeds with funny namespaces.
This commit is contained in:
parent
6787b377c0
commit
115231f917
@ -114,9 +114,10 @@ class DiscoveryHints {
|
|||||||
|
|
||||||
static function _hcard($body, $url)
|
static function _hcard($body, $url)
|
||||||
{
|
{
|
||||||
// DOMDocument::loadHTML may throw warnings on unrecognized elements.
|
// DOMDocument::loadHTML may throw warnings on unrecognized elements,
|
||||||
|
// and notices on unrecognized namespaces.
|
||||||
|
|
||||||
$old = error_reporting(error_reporting() & ~E_WARNING);
|
$old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
$doc->loadHTML($body);
|
$doc->loadHTML($body);
|
||||||
|
@ -196,8 +196,9 @@ class FeedDiscovery
|
|||||||
*/
|
*/
|
||||||
function discoverFromHTML($url, $body)
|
function discoverFromHTML($url, $body)
|
||||||
{
|
{
|
||||||
// DOMDocument::loadHTML may throw warnings on unrecognized elements.
|
// DOMDocument::loadHTML may throw warnings on unrecognized elements,
|
||||||
$old = error_reporting(error_reporting() & ~E_WARNING);
|
// and notices on unrecognized namespaces.
|
||||||
|
$old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
|
||||||
$dom = new DOMDocument();
|
$dom = new DOMDocument();
|
||||||
$ok = $dom->loadHTML($body);
|
$ok = $dom->loadHTML($body);
|
||||||
error_reporting($old);
|
error_reporting($old);
|
||||||
|
Loading…
Reference in New Issue
Block a user