Project

General

Profile

Actions

Patch #26157

closed

Render all possible inline textile images

Added by Holger Just almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

In r15433, Redmine introduced a security measure to restrict embedding images to only those with valid schemes from Textile.

Now, if there are multiple images referenced on a page, with only one of them invalid, Redmine currently doesn't create <img> tags for any of them since it would return from the replacement method too soon.

This patch fixes this behavior in that it still allows to embed all valid images and only refuses to embed the invalid ones by skipping the rest of the current gsub iteration instead of the whole method. The patch was extracted from Planio


Files

Actions #1

Updated by Go MAEDA almost 7 years ago

Confirmed the problem. Setting target version to 3.4.0.

Markup:

!http://www.cs.cmu.edu/~chuck/lennapg/len_std.jpg!

!data:text/html;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAABlBMVEX2Ojr///8SFd07AAAAEklEQVQI12Nk/A+FDFCakSwRAPZFHA3MVemHAAAAAElFTkSuQmCC!

Expected (with the patch applied):

Actual (without the patch):

Actions #2

Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks!

Actions

Also available in: Atom PDF