summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlin-hua-cheng <os.lcheng@gmail.com>2015-06-01 17:55:00 -0700
committerLin Hua Cheng <os.lcheng@gmail.com>2015-06-09 17:45:15 +0000
commitdab92e7d2f576caea8f81c8e22a516fb45633794 (patch)
treeebb7e3d17c4392bd75c827c436b5f43e26ae9874
parente51687980d66c185fbe93025646e64e4dfd96fa1 (diff)
downloadhorizon-dab92e7d2f576caea8f81c8e22a516fb45633794.tar.gz
Escape the description param from heat template
The heat template allows user to define custom parameters, the fields are then converted to input fields. The description param maps to the help_text attribute of the field. Since the value comes from the user, the value must be escaped before rendering. Co-Authored-By: Lin Hua Cheng <os.lcheng@gmail.com> Change-Id: I79d540a8363b2507c4bccdc0cc38e283962919d2 Closes-bug: #1453074
-rw-r--r--openstack_dashboard/dashboards/project/stacks/forms.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/project/stacks/forms.py b/openstack_dashboard/dashboards/project/stacks/forms.py
index 8bff2159a..b37a5d471 100644
--- a/openstack_dashboard/dashboards/project/stacks/forms.py
+++ b/openstack_dashboard/dashboards/project/stacks/forms.py
@@ -13,6 +13,7 @@
import json
import logging
+from django.utils import html
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_variables # noqa
@@ -290,7 +291,7 @@ class CreateStackForm(forms.SelfHandlingForm):
field_args = {
'initial': param.get('Default', None),
'label': param.get('Label', param_key),
- 'help_text': param.get('Description', ''),
+ 'help_text': html.escape(param.get('Description', '')),
'required': param.get('Default', None) is None
}