Use RedirectGuard in ImageProxy
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Mar 2021 10:51:53 +0000 (11:51 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Mar 2021 10:56:08 +0000 (11:56 +0100)
wcfsetup/install/files/lib/action/ImageProxyAction.class.php

index 8e49c9334941ccec2bc978cba87cddf51a4d3dc7..ead31955ad709dc607b2e644867fa318b3d05539 100644 (file)
@@ -9,6 +9,7 @@ use GuzzleHttp\RequestOptions;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\SystemException;
 use wcf\system\io\File;
+use wcf\system\io\http\RedirectGuard;
 use wcf\system\io\HttpFactory;
 use wcf\system\WCF;
 use wcf\util\CryptoUtil;
@@ -69,6 +70,9 @@ class ImageProxyAction extends AbstractAction
             RequestOptions::HEADERS => [
                 'user-agent' => HttpFactory::getDefaultUserAgent("Image Proxy"),
             ],
+            RequestOptions::ALLOW_REDIRECTS => [
+                'on_redirect' => new RedirectGuard(),
+            ],
         ]);
     }