##// END OF EJS Templates
Limits the schemes that inline images can use (#22926)....
Jean-Philippe Lang -
r15051:a4bc8980126f
parent child
Show More
@@ -165,6 +165,7
165 165 # class RedCloth::Textile.new( str )
166 166
167 167 class RedCloth3 < String
168 include Redmine::Helpers::URL
168 169
169 170 VERSION = '3.0.4'
170 171 DEFAULT_RULES = [:textile, :markdown]
@@ -960,6 +961,8 class RedCloth3 < String
960 961 href, alt_title = check_refs( href ) if href
961 962 url, url_title = check_refs( url )
962 963
964 return m unless uri_with_safe_scheme?(url)
965
963 966 out = ''
964 967 out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
965 968 out << "<img#{ shelve( atts ) } />"
@@ -43,6 +43,12 module Redmine
43 43 "<pre>" + CGI.escapeHTML(code) + "</pre>"
44 44 end
45 45 end
46
47 def image(link, title, alt_text)
48 return unless uri_with_safe_scheme?(link)
49
50 tag('img', :src => link, :alt => alt_text || "", :title => title)
51 end
46 52 end
47 53
48 54 class Formatter
General Comments 0
You need to be logged in to leave comments. Login now