aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 08:40:01 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 08:40:01 +0200
commitcac090b659a90749a8ea6ed7f62af980ffe7c60d (patch)
tree154e581503145a6a7b9223850d05bb85626defe7 /phpBB/includes/functions_privmsgs.php
parent359ef56e3538cb91f11587f77ecfc4bc423ebd96 (diff)
parentbb2634b5e5bdee53118eff8cdba3fea73932ff47 (diff)
downloadforums-cac090b659a90749a8ea6ed7f62af980ffe7c60d.tar
forums-cac090b659a90749a8ea6ed7f62af980ffe7c60d.tar.gz
forums-cac090b659a90749a8ea6ed7f62af980ffe7c60d.tar.bz2
forums-cac090b659a90749a8ea6ed7f62af980ffe7c60d.tar.xz
forums-cac090b659a90749a8ea6ed7f62af980ffe7c60d.zip
Merge pull request #3913 from marc1706/ticket/14168
[ticket/14168] Refactor attachment management functions into classes * marc1706/ticket/14168: (36 commits) [ticket/14168] Correctly state return type of upload and upload_attachment [ticket/14168] Use attachment manager instead of separate classes [ticket/14168] Fix docblock in manager [ticket/14168] Add more test cases for attachment manager [ticket/14168] Add new test method and more tests [ticket/14168] Fix tabs in manager and add test file [ticket/14168] Fix tests after rebase [ticket/14168] Add attachment manager service [ticket/14168] Use correct docblock [ticket/14168] Add services_attachment.yml to services.yml [ticket/14168] Minor coding style fixes [ticket/14168] Move attachment service definitions to services_attachment [ticket/14168] Improve code coverage in upload class [ticket/14168] Move image check and don't use trigger_error() [ticket/14168] Add tests for init_error() during upload [ticket/14168] Add basic test file for attachments upload [ticket/14168] Fix CS issue [ticket/14168] No longer use deprecated functions in core files [ticket/14168] Move phpbb_unlink() into attachment delete class [ticket/14168] Reset sequence before tests in delete tests ...
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 7b6540cda7..ee18e85657 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1153,12 +1153,10 @@ function delete_pm($user_id, $msg_ids, $folder_id)
if (sizeof($delete_ids))
{
// Check if there are any attachments we need to remove
- if (!function_exists('delete_attachments'))
- {
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- }
-
- delete_attachments('message', $delete_ids, false);
+ /** @var \phpbb\attachment\manager $attachment_manager */
+ $attachment_manager = $phpbb_container->get('attachment.manager');
+ $attachment_manager->delete('message', $delete_ids, false);
+ unset($attachment_manager);
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
@@ -1363,12 +1361,10 @@ function phpbb_delete_users_pms($user_ids)
if (!empty($delete_ids))
{
// Check if there are any attachments we need to remove
- if (!function_exists('delete_attachments'))
- {
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- }
-
- delete_attachments('message', $delete_ids, false);
+ /** @var \phpbb\attachment\manager $attachment_manager */
+ $attachment_manager = $phpbb_container->get('attachment.manager');
+ $attachment_manager->delete('message', $delete_ids, false);
+ unset($attachment_manager);
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);