aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/OpenGraph.php
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2024-06-18 07:41:19 +0000
committerThomas Hackl <hackl@data-quest.de>2024-06-18 07:41:19 +0000
commit1251e31ff927669abbddf61d08e458667d1d515b (patch)
tree62f663dc493af93c3f973db59e7c0d4d592a586f /lib/classes/OpenGraph.php
parentd7b52c34df2c8dc1b41127f966a42277b3dc510f (diff)
Resolve "Exception in OpenGraph::extract() bei null-String"
Closes #4319 Merge request studip/studip!3119
Diffstat (limited to 'lib/classes/OpenGraph.php')
-rw-r--r--lib/classes/OpenGraph.php6
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;
}