Skip to content

Commit

Permalink
ui: reverse character replacements (#3260)
Browse files Browse the repository at this point in the history
In the cloudstack UI fields get '<', '>' and '&' replaced by xml-entities
these are generic for all fields and hurt us in the case of userdata
this fix calls the existing method to reverse character replacements.
it also removes the ccs class that pretends to prevent special chars

Fixes #3202
  • Loading branch information
DaanHoogland authored and rohityadavcloud committed May 23, 2019
1 parent 3e64285 commit f6ecac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/index.html
Expand Up @@ -558,7 +558,7 @@ <h3><translate key="label.select.iso.or.template" /></h3>
<span><translate key="label.add.userdata"/> (<translate key="label.optional"/>)</span>
</div>
<div class="value">
<textarea name="userdata" class="disallowSpecialCharacters"></textarea>
<textarea name="userdata"></textarea>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion ui/scripts/instanceWizard.js
Expand Up @@ -1094,8 +1094,9 @@

var userdata = args.data.userdata;
if (userdata != null && userdata.length > 0) {

$.extend(deployVmData, {
userdata : encodeURIComponent(btoa(userdata))
userdata : encodeURIComponent(btoa(cloudStack.sanitizeReverse(userdata)))
});
}

Expand Down

0 comments on commit f6ecac4

Please sign in to comment.