From 50a1f2a186c76a6d443a509908d08f7206078b46 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Wed, 5 Apr 2023 12:13:36 +0000
Subject: [PATCH] fixes #2427

Closes #2427

Merge request studip/studip!1706
---
 lib/models/OERMaterial.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php
index 668d8223e44..c84d7b5ff79 100644
--- a/lib/models/OERMaterial.php
+++ b/lib/models/OERMaterial.php
@@ -387,7 +387,7 @@ class OERMaterial extends SimpleORMap
             return false;
         }
         $url = $this->getDownloadUrl();
-        $headers = get_headers($url, true);
+        $headers = get_headers($url, true, get_default_http_stream_context($url));
         if ($headers['Content-Disposition']
             && substr($headers['Content-Disposition'], 0, strlen('attachment')) === 'attachment') {
             //in this case the server forces to download the document and we cannot display it in an iframe:
-- 
GitLab