1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

[ticket/16820] Move ATTACHMENT_CATEGORY_ constants to attachment namespace

PHPBB3-16820
This commit is contained in:
Marc Alexander
2021-10-10 17:52:42 +02:00
parent ddf8e8c9d1
commit b99cfd5caa
11 changed files with 86 additions and 37 deletions

View File

@@ -0,0 +1,32 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\attachment;
abstract class attachment_category
{
/** @var int None category */
public const NONE = 0;
/** @var int Inline images */
public const IMAGE = 1;
/** @var int Not used within the database, only while displaying posts */
public const THUMB = 4;
/** @var int Browser-playable audio files */
public const AUDIO = 7;
/** @var int Browser-playable video files */
public const VIDEO = 8;
}

View File

@@ -131,7 +131,7 @@ class upload
}
// Whether the uploaded file is in the image category
$is_image = (isset($this->extensions[$this->file->get('extension')]['display_cat'])) ? $this->extensions[$this->file->get('extension')]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE : false;
$is_image = (isset($this->extensions[$this->file->get('extension')]['display_cat'])) ? $this->extensions[$this->file->get('extension')]['display_cat'] == \phpbb\attachment\attachment_category::IMAGE : false;
if (!$this->auth->acl_get('a_') && !$this->auth->acl_get('m_', $forum_id))
{