diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2024-06-18 07:41:19 +0000 |
|---|---|---|
| committer | Thomas Hackl <hackl@data-quest.de> | 2024-06-18 09:43:20 +0200 |
| commit | 4a4f1169123326014466d13a23c1f1a8a730b795 (patch) | |
| tree | b536218e5095ffe063510a2ee25dee757cd5c764 | |
| parent | 6a78fc43cccf0f41011e77e808178b7e97ec361e (diff) | |
Resolve "Exception in OpenGraph::extract() bei null-String"
Closes #4319
Merge request studip/studip!3119
| -rw-r--r-- | lib/classes/OpenGraph.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/classes/OpenGraph.php b/lib/classes/OpenGraph.php index fb0ac5c..845f5cb 100644 --- a/lib/classes/OpenGraph.php +++ b/lib/classes/OpenGraph.php @@ -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; } |
