Skip to content

Commit

Permalink
Remove access and icon info for files
Browse files Browse the repository at this point in the history
Fixes #22792
  • Loading branch information
vboctor committed Jan 28, 2018
1 parent 84349ec commit 09306f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
10 changes: 2 additions & 8 deletions api/rest/restcore/issues_rest.php
Expand Up @@ -514,16 +514,10 @@ function rest_issue_files_get( \Slim\Http\Request $p_request, \Slim\Http\Respons
foreach( $t_internal_files as $t_internal_file ) {
$t_file = array(
'id' => (int)$t_internal_file['id'],
'filename' => $t_internal_file['display_name'],
'reporter' => mci_account_get_array_by_id( $t_internal_file['user_id'] ),
'size' => (int)$t_internal_file['size'],
'created_at' => ApiObjectFactory::datetimeString( $t_internal_file['date_added'] ),
'icon' => $t_internal_file['icon']['url'],
'alt' => $t_internal_file['alt'],
'access' => array(
'download' => $t_internal_file['can_download'],
'delete' => $t_internal_file['can_delete']
)
'filename' => $t_internal_file['display_name'],
'size' => (int)$t_internal_file['size'],
);

if( $t_internal_file['exists'] ) {
Expand Down
21 changes: 7 additions & 14 deletions api/soap/mc_issue_api.php
Expand Up @@ -495,30 +495,23 @@ function mci_issue_get_attachments( $p_issue_id ) {
foreach( $t_attachment_rows as $t_attachment_row ) {
$t_attachment = array();
$t_attachment['id'] = (int)$t_attachment_row['id'];
$t_attachment['filename'] = $t_attachment_row['display_name'];
$t_attachment['size'] = (int)$t_attachment_row['size'];
$t_attachment['content_type'] = $t_attachment_row['file_type'];

$t_created_at = ApiObjectFactory::datetime( $t_attachment_row['date_added'] );

if( ApiObjectFactory::$soap ) {
$t_attachment['download_url'] = mci_get_mantis_path() . 'file_download.php?file_id=' . $t_attachment_row['id'] . '&type=bug';
$t_attachment['user_id'] = (int)$t_attachment_row['user_id'];
$t_attachment['date_submitted'] = $t_created_at;
} else {
$t_attachment['icon'] = $t_attachment_row['icon']['url'];
$t_attachment['alt'] = $t_attachment_row['alt'];
$t_attachment['access'] = array(
'download' => $t_attachment_row['can_download'],
'delete' => $t_attachment_row['can_delete']
);

$t_attachment['reporter'] = mci_account_get_array_by_id( $t_attachment_row['user_id'] );
$t_attachment['created_at'] = $t_created_at;
}

$t_attachment['filename'] = $t_attachment_row['display_name'];
$t_attachment['size'] = (int)$t_attachment_row['size'];
$t_attachment['content_type'] = $t_attachment_row['file_type'];

if( ApiObjectFactory::$soap ) {
$t_attachment['user_id'] = (int)$t_attachment_row['user_id'];
} else {
$t_attachment['reporter'] = mci_account_get_array_by_id( $t_attachment_row['user_id'] );
$t_attachment['download_url'] = mci_get_mantis_path() . 'file_download.php?file_id=' . $t_attachment_row['id'] . '&type=bug';
}

$t_result[] = $t_attachment;
Expand Down

0 comments on commit 09306f2

Please sign in to comment.