Project

General

Profile

Feature #32424 » 0006-Fixes-HTTP-500-error-when-invalid-URIs-are-provided-.patch

Marius BĂLTEANU, 2021-07-04 12:21

View differences:

lib/redmine/wiki_formatting/common_mark/external_links_filter.rb
31 31
            next unless url
32 32
            next if url.starts_with?("/") || url.starts_with?("#") || !url.include?(':')
33 33

  
34
            scheme = URI.parse(url).scheme
35
            next if scheme.blank?
34
            begin
35
              scheme = URI.parse(url).scheme
36
              next if scheme.blank?
37
            rescue URI::InvalidURIError
38
              next
39
            end
36 40

  
37 41
            klass = node["class"].presence
38 42
            node["class"] = [
(14-14/26)