From 54c68519ce1cab9baaf86a29c7172811767d97c4 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 29 Mar 2017 13:39:48 +0200 Subject: [PATCH 1/2] Allow avatars for full numeric users Fixes #4087 Because of fancy javascript if a full numeric uid was used javascript would convert this to an int. Now we just convert everything to a string first. Signed-off-by: Roeland Jago Douma --- core/js/jquery.avatar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 1abe70b79ea..703bd9fd7dd 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -48,6 +48,9 @@ (function ($) { $.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) { + user = String(user); + displayname = String(displayname); + if (typeof(size) === 'undefined') { if (this.height() > 0) { size = this.height(); From 0da04fd284c827e1d745fa372efd6587d165cddd Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 29 Mar 2017 22:54:08 +0200 Subject: [PATCH 2/2] Fix tests Signed-off-by: Roeland Jago Douma --- core/js/jquery.avatar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 703bd9fd7dd..29d019baea7 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -48,8 +48,12 @@ (function ($) { $.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) { - user = String(user); - displayname = String(displayname); + if (typeof(user) !== 'undefined') { + user = String(user); + } + if (typeof(displayname) !== 'undefined') { + displayname = String(displayname); + } if (typeof(size) === 'undefined') { if (this.height() > 0) {