From: Tim Düsterhus Date: Thu, 18 Mar 2021 10:51:22 +0000 (+0100) Subject: Use RedirectGuard during URL unfurling X-Git-Tag: 5.4.0_Alpha_1~131^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f4817cf4f50a5d95fb64201b8bbe8988af44c4bf;p=GitHub%2FWoltLab%2FWCF.git Use RedirectGuard during URL unfurling --- diff --git a/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php b/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php index 85f4102158..f53b8c0cf4 100644 --- a/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php +++ b/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php @@ -10,6 +10,7 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use GuzzleHttp\RequestOptions; use Psr\Http\Client\ClientExceptionInterface; +use wcf\system\io\http\RedirectGuard; use wcf\system\io\HttpFactory; use wcf\system\message\unfurl\exception\DownloadFailed; use wcf\system\message\unfurl\exception\ParsingFailed; @@ -329,6 +330,9 @@ final class UnfurlResponse RequestOptions::HEADERS => [ 'user-agent' => HttpFactory::getDefaultUserAgent("UrlUnfurling"), ], + RequestOptions::ALLOW_REDIRECTS => [ + 'on_redirect' => new RedirectGuard(), + ], ]); }