liquid_feedback_frontend
view app/main/draft/_action/add.lua @ 1486:00ce64d26e9e
Fixed redirection after registration without redirect params
| author | bsw | 
|---|---|
| date | Sun Nov 04 19:32:13 2018 +0100 (2018-11-04) | 
| parents | 32cc544d5a5b | 
| children | 17e7082c377a | 
 line source
     1 local draft_text = param.get("content")
     3 if not draft_text then
     4   return false
     5 end
     7 local draft_text = util.wysihtml_preproc(draft_text)
     9 local valid_html, error_message = util.html_is_safe(draft_text)
    10 if not valid_html then
    11   slot.put_into("error", _("Draft contains invalid formatting or character sequence: #{error_message}", { error_message = error_message }) )
    12   return false
    13 end
    15 if config.initiative_abstract then
    16   local abstract = param.get("abstract")
    17   if not abstract then
    18     return false
    19   end
    20   abstract = encode.html(abstract)
    21   draft_text = abstract .. "<!--END_OF_ABSTRACT-->" .. draft_text
    22 end
    24 return Draft:update_content(
    25   app.session.member.id, 
    26   param.get("initiative_id", atom.integer),
    27   param.get("formatting_engine"),
    28   draft_text,
    29   nil,
    30   param.get("preview") or param.get("edit")
    31 )
