Project

General

Profile

Actions

Defect #38968

open

Images not showing up when space(s) in filename

Added by Thomas B 8 months ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Files
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Hi,

i'm currently testing Redmine 5.0.5 which is an upgrade from 4.2.3
I notice that images containing spaces in the filename that we upload through CKEditor aren't displayed anymore.
Also the image selector shows the filename up until the space.
ie, an image called 'IMG_2023 Forest.png' will show up as 'IMG_2023' with then an 'image not available' cross in the thumbail for what should be the image.

How can i make it so that the spaces in the filename arent an issue anymore?

Attached is a screenshot showing how it looks in 4.2.3 (left) and 5.0.5 (right)


Files

old-vs-new_redmine.png (65.8 KB) old-vs-new_redmine.png Thomas B, 2023-08-21 15:49
Actions #1

Updated by Eric Brun 8 months ago

Hi,

I had same issue with CKEditor Plugin (Redminex) when I upgrade Redmine from 4 to 5.
In the CKEditor plugin you can fix it by editing the following file :

%{REDMINE_HOME}/plugins/redmine_ckeditor/rich/lib/rich/url_generator.rb

and change the escape_url method by :

def escape_url(url)
      if url.respond_to?(:escape)
        url.escape
      else
        #escaped = URI.escape(url).gsub(escape_regex){|m| "%#{m.ord.to_s(16).upcase}" }
        #CGI.escape(url).gsub("%2F", "/") <= The wrong escape
        url
      end
    end

Hope that help,

Eric

Actions #2

Updated by Thomas B 8 months ago

Hi eric,

that seems to have fixed the issue.

Thank you very much

BR,

Actions #3

Updated by Mischa The Evil 6 months ago

  • Affected version changed from 5.0.4 to 5.0.5
Actions

Also available in: Atom PDF