Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

View file

@ -1,7 +1,8 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
# Copyright (C) 2006-2019 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -51,6 +52,7 @@ module Redmine
end
def SetFont(family, style='', size=0, fontfile='')
style = +style
# FreeSerif Bold Thai font has problem.
style.delete!('B') if family.to_s.casecmp('freeserif') == 0
# DejaVuSans Italic Arabic and Persian font has problem.
@ -69,7 +71,7 @@ module Redmine
Redmine::WikiFormatting.to_html(Setting.text_formatting, text)
end
def RDMCell(w ,h=0, txt='', border=0, ln=0, align='', fill=0, link='')
def RDMCell(w, h=0, txt='', border=0, ln=0, align='', fill=0, link='')
cell(w, h, txt, border, ln, align, fill, link)
end
@ -91,7 +93,7 @@ module Redmine
</style>'
# Strip {{toc}} tags
txt.gsub!(/<p>\{\{([<>]?)toc\}\}<\/p>/i, '')
txt = txt.gsub(/<p>\{\{((<|&lt;)|(>|&gt;))?toc\}\}<\/p>/i, '')
writeHTMLCell(w, h, x, y, css_tag + txt, border, ln, fill)
end
@ -133,15 +135,13 @@ module Redmine
class RDMPdfEncoding
def self.rdm_from_utf8(txt, encoding)
txt ||= ''
txt = Redmine::CodesetUtil.from_utf8(txt, encoding)
txt.force_encoding('ASCII-8BIT')
txt
Redmine::CodesetUtil.from_utf8(txt, encoding).b
end
def self.attach(attachments, filename, encoding)
filename_utf8 = Redmine::CodesetUtil.to_utf8(filename, encoding)
atta = nil
if filename_utf8 =~ /^[^\/"]+\.(gif|jpg|jpe|jpeg|png)$/i
if /^[^\/"]+\.(gif|jpg|jpe|jpeg|png)$/i.match?(filename_utf8)
atta = Attachment.latest_attach(attachments, filename_utf8)
end
if atta && atta.readable? && atta.visible?