diff options
author | kondou <kondou@ts.unde.re> | 2013-08-31 18:27:28 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-31 18:27:28 +0200 |
commit | aa88eea9cf366c07b0a311adc5ee64f0ae86ff33 (patch) | |
tree | dd9a4a47f56e4eb688366a70f1bd0fb7dd2c5a36 /core/js | |
parent | 5d653753bd8f6f1294dfbfa112757e5509ddc80d (diff) | |
download | nextcloud-server-aa88eea9cf366c07b0a311adc5ee64f0ae86ff33.tar.gz nextcloud-server-aa88eea9cf366c07b0a311adc5ee64f0ae86ff33.zip |
Sanitize displayname, respect data @ $element, fix routename, clean after cropping, updateAvatar with displayname
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/jquery.avatar.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index bd57a542fa7..b4fa524f47a 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -10,6 +10,8 @@ if (typeof(size) === 'undefined') { if (this.height() > 0) { size = this.height(); + } else if (this.data('size') > 0) { + size = this.data('size'); } else { size = 64; } @@ -19,10 +21,17 @@ this.width(size); if (typeof(user) === 'undefined') { - this.placeholder('x'); - return; + if (typeof(this.data('user')) !== 'undefined') { + user = this.data('user'); + } else { + this.placeholder('x'); + return; + } } + // sanitize + user = user.replace(/\//g,''); + var $div = this; //$.get(OC.Router.generate('core_avatar_get', {user: user, size: size}), function(result) { // TODO does not work "Uncaught TypeError: Cannot use 'in' operator to search for 'core_avatar_get' in undefined" router.js L22 |