Browse Source

fix(conference): ensure avatar url and email changes act on strings

Both conference.changeLocalEmail and conference.changeLocalAvatarUrl
are exposed in the external api. It is possible for users to then
pass in non-string values. To make it more visibly obvious of the
error and to prevent script errors, convert whatever is passed in
into a string.
j8
Leonard Kim 8 years ago
parent
commit
0451e7c9e7
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      conference.js

+ 2
- 2
conference.js View File

@@ -2051,7 +2051,7 @@ export default {
2051 2051
      * @param email {string} the new email
2052 2052
      */
2053 2053
     changeLocalEmail(email = '') {
2054
-        email = email.trim();
2054
+        email = String(email).trim();
2055 2055
 
2056 2056
         if (email === APP.settings.getEmail()) {
2057 2057
             return;
@@ -2075,7 +2075,7 @@ export default {
2075 2075
      * @param url {string} the new url
2076 2076
      */
2077 2077
     changeLocalAvatarUrl(url = '') {
2078
-        url = url.trim();
2078
+        url = String(url).trim();
2079 2079
 
2080 2080
         if (url === APP.settings.getAvatarUrl()) {
2081 2081
             return;

Loading…
Cancel
Save