You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2019/05/23 05:50:54 UTC

[cloudstack] branch master updated: ui: reverse character replacements (#3260)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new f6ecac4  ui: reverse character replacements (#3260)
f6ecac4 is described below

commit f6ecac42ac840b454cf6c6eeb8f592277e15c4a7
Author: dahn <da...@gmail.com>
AuthorDate: Thu May 23 07:50:42 2019 +0200

    ui: reverse character replacements (#3260)
    
    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
---
 ui/index.html                | 2 +-
 ui/scripts/instanceWizard.js | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui/index.html b/ui/index.html
index b9d961d..a71d823 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -558,7 +558,7 @@
                                             <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>
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 351ca7b..1234cfa 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -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)))
                 });
             }