weizhouapache commented on code in PR #8791:
URL: https://github.com/apache/cloudstack/pull/8791#discussion_r1526235912


##########
ui/src/utils/plugins.js:
##########
@@ -490,8 +499,7 @@ export const genericUtilPlugin = {
     }
 
     app.config.globalProperties.$toBase64AndURIEncoded = function (text) {
-      const base64regex = 
/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/
-      if (base64regex.test(text)) {
+      if (isBase64(text)) {

Review Comment:
   oh, wait @Pearl1594 
   the method `toBase64AndURIEncoded` is being used in some other files..
   
   ```
   ui/src/utils/plugins.js:    
app.config.globalProperties.$toBase64AndURIEncoded = function (text) {
   ui/src/views/compute/CreateAutoScaleVmGroup.vue:          
createVmGroupData.userdata = this.$toBase64AndURIEncoded(values.userdata)
   ui/src/views/compute/DeployVM.vue:          deployVmData.userdata = 
this.$toBase64AndURIEncoded(values.userdata)
   ui/src/views/compute/DeployVnfAppliance.vue:          
createVnfAppData.userdata = this.$toBase64AndURIEncoded(values.userdata)
   ui/src/views/compute/EditVM.vue:          params.userdata = 
this.$toBase64AndURIEncoded(values.userdata)
   ui/src/views/compute/RegisterUserData.vue:        params.userdata = 
this.$toBase64AndURIEncoded(values.userdata)
   ui/src/views/compute/ResetUserData.vue:        params.userdata = 
this.$toBase64AndURIEncoded(values.userdata)
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to