Skip to content

File isn't shown when it contains a comma in the title #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ane-gabriela opened this issue Jun 6, 2023 · 3 comments
Closed

File isn't shown when it contains a comma in the title #136

ane-gabriela opened this issue Jun 6, 2023 · 3 comments

Comments

@ane-gabriela
Copy link

Preconditions:
The office server needs to be configured and connected to the XWiki instance. Add attachments to the page used (doc, docx, xls, xlsx, ppt, pptx, and pdf) that have special characters in the title.

Steps to reproduce:

  1. Edit a page
  2. Click on Insert > Other macros
  3. Search and select View Files
  4. In the "att--filename" text box add the name of a file from the attachments section, including the file extension eg. "Te$t with #special + ch@rs - test. It's ^a test! Test 1 = and (2) & {3}, [4]. 100% a test 1; 2` 3; 5. and 10 spaces."
  5. Click on Submit
  6. Click on Save & View

Expected results: The document selected is shown in the wiki page.

Actual results: Because of the comma , the title of the attachment is separated in 2 separate tabs which results in an error "Error: The document [xwiki:View Files macro.Te$t with #special + ch] does not exists or you have no access to that document." The file isn't shown.

ViewFilesMacro

Environment: Windows 11, XWiki 14.10.10 with MySQL 8.0, Chrome 114, Pro Macros 1.9

@ClemensRobbenhaar
Copy link
Contributor

Side note: also appears without office server when using an PDF for me. The actual issue is that the office and pdfviewer macros use the comma as separator to show several files. This comma needs to be e.g. escaped if part of a file name.

@snazare
Copy link
Contributor

snazare commented Jul 26, 2023

to check if pdf viewer supports escaping and if so, escape the comma in the file name given to the view file macro.

@snazare snazare assigned oanalavinia and unassigned snazare Aug 9, 2023
oanalavinia added a commit that referenced this issue Sep 28, 2023
* thi will also fix  File isn't shown when it contains a comma in the title #136
@oanalavinia oanalavinia added this to the 1.10 milestone Sep 28, 2023
@oanalavinia
Copy link
Contributor

I reproduced this bug only for PDF files.
The PDFViewer issue was fixed as part of the 2.5.2 release and the dependency was upgraded in 01e2b2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants