Skip to content
Snippets Groups Projects
Commit dbc1e9d5 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 e8ab5e4f
No related branches found
No related tags found
No related merge requests found
...@@ -11,14 +11,14 @@ class OpenGraph ...@@ -11,14 +11,14 @@ class OpenGraph
/** /**
* Extracts urls and their according open graph infos from a given string * 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 * @return OpenGraphURLCollection containing the extracted urls
*/ */
public static function extract(string $string): OpenGraphURLCollection public static function extract(?string $string): OpenGraphURLCollection
{ {
$collection = new OpenGraphURLCollection(); $collection = new OpenGraphURLCollection();
if (!Config::get()->OPENGRAPH_ENABLE) { if (!Config::get()->OPENGRAPH_ENABLE || !$string) {
return $collection; 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