Fix media file access in ACP when not logged-in in frontend
authorMatthias Schmidt <gravatronics@live.com>
Sat, 2 Jul 2016 11:26:17 +0000 (13:26 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 2 Jul 2016 11:26:17 +0000 (13:26 +0200)
wcfsetup/install/files/lib/acp/page/MediaPage.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/data/media/Media.class.php

diff --git a/wcfsetup/install/files/lib/acp/page/MediaPage.class.php b/wcfsetup/install/files/lib/acp/page/MediaPage.class.php
new file mode 100644 (file)
index 0000000..cabc13b
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+namespace wcf\acp\page;
+
+/**
+ * Shows a media file in the ACP.
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2016 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\Acp\Page
+ * @since      3.0
+ */
+class MediaPage extends \wcf\page\MediaPage {}
index dd10d0d1edb7766fd51d0308d5afc6a5322499b9..0d4b41c12c9f7686012c857646d4ba01e4b694b8 100644 (file)
@@ -99,9 +99,8 @@ class Media extends DatabaseObject implements ILinkableObject, IRouteController,
        /**
         * @inheritDoc
         */
-       public function getLink($articleID = null, $boxID = null, $messageObjectType = null, $messageID = null) {
+       public function getLink() {
                return LinkHandler::getInstance()->getLink('Media', array_merge($this->linkParameters, [
-                       'forceFrontend' => true,
                        'object' => $this
                ]));
        }
@@ -135,7 +134,6 @@ class Media extends DatabaseObject implements ILinkableObject, IRouteController,
                }
                
                return LinkHandler::getInstance()->getLink('Media', array_merge($this->linkParameters, [
-                       'forceFrontend' => true,
                        'object' => $this,
                        'thumbnail' => $size
                ]));