Fix the redirect for legacy attachment links
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2024 15:09:08 +0000 (17:09 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2024 15:09:08 +0000 (17:09 +0200)
wcfsetup/install/files/lib/page/AttachmentPage.class.php

index 44a28f1e524ef391151c744b012f7496115ca74b..8bffb9a48af17aad04feef6def234aefe685edaa 100644 (file)
@@ -209,6 +209,10 @@ class AttachmentPage extends AbstractPage
     {
         parent::show();
 
+        if ($this->attachment->getFile() !== null) {
+            return;
+        }
+
         // etag caching
         if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == '"' . $this->eTag . '"') {
             return new EmptyResponse(304);