Project

General

Profile

Actions

Defect #38728

closed

Correctly escape issue text in Gantt PNG export for ImageMagick convert

Added by Holger Just 11 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gantt
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

According to https://imagemagick.org/Usage/draw/#text, we need to quote the passed text and only escape the quote character and backslash with backslashes respectively. Redmine::Utils::Shell.shell_quote escapes the single quote for a wrong environment (namely a shell) which results in errors if an issue subject contains a single quote character.

The attached patch fixes this by using specific quoting/escaping for the ImageMagick convert command.

Note that the usual shell special characters (such as $, `, ...) do not need to be escaped here since the shellouts performed by MiniMagick are perfomed with Open3.popen3 which does not launch a shell but runs the command directly.


Files


Related issues

Related to Redmine - Feature #30492: Replace RMagick with MiniMagickClosedGo MAEDA

Actions
Related to Redmine - Defect #34046: Escaping symbols in task subject can broke export to Gantt (PNG)Needs feedback

Actions
Actions

Also available in: Atom PDF