diff --git a/lib/models/OpenGraphURL.php b/lib/models/OpenGraphURL.php
index 29e5718ff0d928d760d0b39677babae9366dc91e..3caf3c4d25531c727887b991dd9627d970a2f69e 100644
--- a/lib/models/OpenGraphURL.php
+++ b/lib/models/OpenGraphURL.php
@@ -170,7 +170,7 @@ class OpenGraphURL extends SimpleORMap
             }
 
             $context = get_default_http_stream_context($this['url']);
-            stream_context_set_option($context, [
+            stream_context_set_options($context, [
                 'http' => [
                     'method' => 'GET',
                     'header' => sprintf("User-Agent: Stud.IP v%s OpenGraph Parser\r\n", $GLOBALS['SOFTWARE_VERSION']),
diff --git a/lib/plugins/engine/PluginRepository.php b/lib/plugins/engine/PluginRepository.php
index 4bd24c6dfe131e99e883bbe6d11033129495c32b..303501b4d5efb76b5002ce387d807cce0a0cde72 100644
--- a/lib/plugins/engine/PluginRepository.php
+++ b/lib/plugins/engine/PluginRepository.php
@@ -63,7 +63,7 @@ class PluginRepository
             // Set small timeout for the rare case that the repository is not
             // available
             $context = get_default_http_stream_context($url);
-            stream_context_set_option($context, ['http' => [
+            stream_context_set_options($context, ['http' => [
                 'timeout' => 5,
             ]]);
             $metadata = @file_get_contents($url, false, $context);