Skip to content
Snippets Groups Projects
Commit 1251e31f authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Resolve "Exception in OpenGraph::extract() bei null-String"

Closes #4319

Merge request studip/studip!3119
parent d7b52c34
No related branches found
No related tags found
No related merge requests found
......@@ -11,14 +11,14 @@ class OpenGraph
/**
* Extracts urls and their according open graph infos from a given string
*
* @param string $string Text to extract urls and open graph infos from
* @param string|null $string Text to extract urls and open graph infos from
* @return OpenGraphURLCollection containing the extracted urls
*/
public static function extract(string $string): OpenGraphURLCollection
public static function extract(?string $string): OpenGraphURLCollection
{
$collection = new OpenGraphURLCollection();
if (!Config::get()->OPENGRAPH_ENABLE) {
if (!Config::get()->OPENGRAPH_ENABLE || !$string) {
return $collection;
}
......
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