fix_for_22967.patch

Marius BALTEANU, 2018-03-31 15:17

Download (965 Bytes)

View differences:

app/helpers/application_helper.rb
19 19

  
20 20
require 'forwardable'
21 21
require 'cgi'
22
require 'htmlentities'
22 23

  
23 24
module ApplicationHelper
24 25
  include Redmine::WikiFormatting::Macros::Definitions
......
739 740
      link_project = project
740 741
      esc, all, page, title = $1, $2, $3, $5
741 742
      if esc.nil?
743
        page = decode_html_entities(page)
742 744
        if page =~ /^([^\:]+)\:(.*)$/
743 745
          identifier, page = $1, $2
744 746
          link_project = Project.find_by_identifier(identifier) || Project.find_by_name(identifier)
......
1500 1502
    name = identifier.gsub(%r{^"(.*)"$}, "\\1")
1501 1503
    return CGI.unescapeHTML(name)
1502 1504
  end
1505

  
1506
  def decode_html_entities(page)
1507
    @coder ||= HTMLEntities.new()
1508
    @coder.decode(page)
1509
  end
1503 1510
end