Skip to content
Snippets Groups Projects
Commit 39a73bb0 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

Merge branch '50-opengraph-fehler-abfangen' into 'main'

OpenGraph: surpress warnings when fetching, abort on fail

Closes #50

See merge request studip/studip!8
parents e3161ffe 54e80c9b
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,12 @@ class OpenGraphURL extends SimpleORMap ...@@ -172,7 +172,12 @@ class OpenGraphURL extends SimpleORMap
], ],
]); ]);
$content = file_get_contents($this['url'], false, $context); $content = @file_get_contents($this['url'], false, $context);
if ($content === false) {
return;
}
$content = mb_encode_numericentity($content, [0x80, 0xffff, 0, 0xffff], $currentEncoding); $content = mb_encode_numericentity($content, [0x80, 0xffff, 0, 0xffff], $currentEncoding);
$old_libxml_error = libxml_use_internal_errors(true); $old_libxml_error = libxml_use_internal_errors(true);
$doc = new DOMDocument(); $doc = new DOMDocument();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment