|
|
|
@ -10,6 +10,19 @@ module ApplicationHelper
|
|
|
|
|
|
|
|
|
|
ONE_YEAR = 12 * ONE_MONTH
|
|
|
|
|
|
|
|
|
|
# xss共计问题
|
|
|
|
|
def content_safe content
|
|
|
|
|
tags = %w(
|
|
|
|
|
a abbr b bdo blockquote br caption cite code col colgroup dd del dfn dl
|
|
|
|
|
dt em figcaption figure h1 h2 h3 h4 h5 h6 hgroup i img ins kbd li mark
|
|
|
|
|
ol p pre q rp rt ruby s samp small strike strong sub sup table tbody td
|
|
|
|
|
tfoot th thead time tr u ul var wbr div span
|
|
|
|
|
)
|
|
|
|
|
attributes = %w(href src width height alt cite datetime title class name xml:lang abbr style)
|
|
|
|
|
sanitize content, tags: tags, attributes: attributes
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 全局参数配置
|
|
|
|
|
def edu_setting name
|
|
|
|
|
EduSetting.get(name)
|
|
|
|
|