Escape success message (#3644)
This commit is contained in:
parent
cd27a947d0
commit
d366bde7c1
2 changed files with 3 additions and 4 deletions
|
|
@ -350,10 +350,9 @@
|
|||
{% block script %}
|
||||
|
||||
<script>
|
||||
{% set seccess_msg = success_message.replace("'", "\'") %}
|
||||
window.web_form_settings = {
|
||||
allow_incomplete: {{ allow_incomplete or 0 }},
|
||||
success_link: '<p>{{ success_msg or _("Your information has been submitted") }}</p><p><a href="{{ success_url or "/" }}" class="btn btn-sm btn-default">{{ _("Continue") }}</a></p>',
|
||||
success_link: '<p>{{ success_message or _("Your information has been submitted") }}</p><p><a href="{{ success_url or "/" }}" class="btn btn-sm btn-default">{{ _("Continue") }}</a></p>',
|
||||
datepicker_format: "{{ frappe.date_format }}",
|
||||
web_form_doctype: "{{ doc_type }}",
|
||||
web_form_name: "{{ name }}",
|
||||
|
|
|
|||
|
|
@ -164,8 +164,8 @@ def get_context(context):
|
|||
and (frappe.session.user!="Guest" or not self.login_required))
|
||||
|
||||
if context.success_message:
|
||||
context.success_message = context.success_message.replace("\n",
|
||||
"<br>").replace("'", "\'")
|
||||
context.success_message = frappe.db.escape(context.success_message.replace("\n",
|
||||
"<br>"))
|
||||
|
||||
self.add_custom_context_and_script(context)
|
||||
if not context.max_attachment_size:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue