Link images attached to the issue by name
Closed this issue · 9 comments
Hello, I have a question:
I often upload images to the issue and then use them in the text of the issue as:
[img]/file_download.php?file_id=2560&type=bug[/img]
This approach needs to create an issue with the text, then upload the images to the issue, edit the text and add the images to the text of the issue, which is inconvenient.
Would it be possible to use some tag that would allow to use the images uploaded to the issue by name (as I know, the attachment names are unique within an issue) - for example
[imgx]MyImageUploadedToTheIssue.png[/imgx].
Thank you very much
Best Regards
Vladimír Duša
@atrol , @dregad quick question on this. Is there a setting in mantisbt where one can control whether you can link external images? After all these years I have noticed any images from external sites are not rendered. I am currently reworking the parsing code to address many of the issues here, and noticed that external images are not rendered in the text.
Is there a setting in mantisbt where one can control whether you can link external images?
No
I have noticed any images from external sites are not rendered.
Do you get CSP violations in browser?
If so, you have to add your own CSP header, e.g. https://github.com/mantisbt/mantisbt/blob/release-2.19.0/plugins/Gravatar/Gravatar.php#L118
Aaah...yeah, that's what it is. And yes, I have started working with http_csp_add
. Thanks so much for adding that functionality!
@atrol Sorry to bother you once again, but could you tell me on which version of Mantis 2.x was http_csp_add
introduced?
Available since 1.3.1 mantisbt/mantisbt@a905dd0
That is great news, thank you!
@atrol, I am finding a weird situation with a brand new installation of Mantis 2.19. As part of working on this request, I am trying to upload a jpg file to the system, and I keep getting this error:
Content Security Policy: The page’s settings blocked the loading of a resource at data:image/jpeg;base64,/9j/4AAQSkZJRgABA… (“img-src”).
I have not overriden any CSP settings, beyond adding the ones from BBCodePlus:
# relax csp when processing markitup.
if ( (ON == plugin_config_get( 'process_markitup' )) && function_exists( 'http_csp_add' ) ) {
http_csp_add( 'script-src', "'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js" );
http_csp_add( 'img-src', "*" );
http_csp_add( 'frame-ancestors', "'self'" );
}
I have checked the forums and the bug tracker but could find no info on what could be causing this issue.
No time to have a deeper look.
Please try 2.20 as there is a change in it concerning ing-src CSP
mantisbt/mantisbt@9efa27c
https://www.mantisbt.org/bugs/view.php?id=25465
Thanks. It seems the error affects only the preview but not the uploading, which is all I need at the moment to try my hand at tackling this feature request.