Merged r1399, r1403, r1405 and r1406 from trunk.

git-svn-id: http://redmine.rubyforge.org/svn/branches/0.7-stable@1407 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-05-02 18:39:32 +00:00
parent 914d1e6645
commit 8bc721c264
9 changed files with 41 additions and 6 deletions

View File

@@ -1134,7 +1134,7 @@ class RedCloth < String
ALLOWED_TAGS = %w(redpre pre code)
def escape_html_tags(text)
text.gsub!(%r{<(\/?(\w+)[^>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' if $3}" }
text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
end
end

View File

@@ -56,7 +56,7 @@ module Redmine
content = @pre_list[$1.to_i]
if content.match(/<code\s+class="(\w+)">\s?(.+)/m)
content = "<code class=\"#{$1} CodeRay\">" +
CodeRay.scan($2, $1).html(:escape => false, :line_numbers => :inline)
CodeRay.scan($2, $1.downcase).html(:escape => false, :line_numbers => :inline)
end
content
end

View File

@@ -92,7 +92,7 @@ namespace :redmine do
set_table_name :milestone
def due
if read_attribute(:due) > 0
if read_attribute(:due) && read_attribute(:due) > 0
Time.at(read_attribute(:due)).to_date
else
nil