liquid_feedback_frontend

diff app/main/draft/_action/add.lua @ 1309:32cc544d5a5b

Cumulative patch for upcoming frontend version 4
author bsw/jbe
date Sun Jul 15 14:07:29 2018 +0200 (2018-07-15)
parents 24f4c23f76ff
children 17e7082c377a
line diff
     1.1 --- a/app/main/draft/_action/add.lua	Thu Jun 23 03:30:57 2016 +0200
     1.2 +++ b/app/main/draft/_action/add.lua	Sun Jul 15 14:07:29 2018 +0200
     1.3 @@ -1,8 +1,31 @@
     1.4 +local draft_text = param.get("content")
     1.5 +
     1.6 +if not draft_text then
     1.7 +  return false
     1.8 +end
     1.9 +
    1.10 +local draft_text = util.wysihtml_preproc(draft_text)
    1.11 +
    1.12 +local valid_html, error_message = util.html_is_safe(draft_text)
    1.13 +if not valid_html then
    1.14 +  slot.put_into("error", _("Draft contains invalid formatting or character sequence: #{error_message}", { error_message = error_message }) )
    1.15 +  return false
    1.16 +end
    1.17 +
    1.18 +if config.initiative_abstract then
    1.19 +  local abstract = param.get("abstract")
    1.20 +  if not abstract then
    1.21 +    return false
    1.22 +  end
    1.23 +  abstract = encode.html(abstract)
    1.24 +  draft_text = abstract .. "<!--END_OF_ABSTRACT-->" .. draft_text
    1.25 +end
    1.26 +
    1.27  return Draft:update_content(
    1.28    app.session.member.id, 
    1.29    param.get("initiative_id", atom.integer),
    1.30    param.get("formatting_engine"),
    1.31 -  param.get("content"),
    1.32 +  draft_text,
    1.33    nil,
    1.34    param.get("preview") or param.get("edit")
    1.35  )

Impressum / About Us