Image Filenames with Parenthesis used inside Issue Tracker Text Editor Fail

Issue #18372 new
S I
created an issue

Your system also does not accept attachment images that inlcude (1) (i.e () parentheses inside the Issue Tracker description text field - very often I have files I am using which have the same file name so my PC auto increments (i.e photo.png, photo(1).png, photo(2).png) - your generated URL string does not allow for the parenthesis to be included in the filename meaning I have to rename the file every time!

Steps:

1) Create an Issue

2) Tap the Image icon in toolbar editor

3) Select an image that includes parenthesis - i.e IMG_6676(1).PNG

4) Fill out some test text inside the Issue and press "Create Issue"

5) You will receive the following result after the issue is posted - see screen shot:

parenthesis_issue.png

I think the reason for this might be that parenthesis have not been utilised correctly in the initial string to handle when a file has parenthesis in the filename. Here is the string you are currently using:

![IMG_7760(1).PNG](https://bitbucket.org/repo/******/images/1195010736-IMG_7760(1).PNG)

The parenthesis after 1) is ending the string causing .PNG) to be displayed after the issue is Created and hence breaking the URL to the correct image.

I think a quick fix would be to detect ( and ) in the file name and auto change ( to %28 and ) to %29 in the string name - this works and fixes the issues but you might have a cleaner solution.

For example the above string would change to:

![IMG_7760(1).PNG](https://bitbucket.org/repo/******/images/1195010736-IMG_7760%281%29.PNG)

After making this update to the string name as displayed above the image now displays correctly and the URL is not broken.

parenthesis_Fixed.png

As mentioned above it should be simple to fix and would mean I (and I am sure many others!!) don't have to rename images every time we come across a parenthesis in the image name :)