Skip to content
Snippets Groups Projects
Commit 0ea6de2f authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Encode Requesttoken for avatars

Fixes new avatar selection in master half, other half will work when https://github.com/owncloud/core/pull/14266 has get merged.

Shocking to see how much places in our code do it wrong :gun:
parent 8e6a7350
Branches
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ function showAvatarCropper () {
var $cropperImage = $('#cropper img');
$cropperImage.attr('src',
OC.generateUrl('/avatar/tmp') + '?requesttoken=' + oc_requesttoken + '#' + Math.floor(Math.random() * 1000));
OC.generateUrl('/avatar/tmp') + '?requesttoken=' + encodeURIComponent(oc_requesttoken) + '#' + Math.floor(Math.random() * 1000));
// Looks weird, but on('load', ...) doesn't work in IE8
$cropperImage.ready(function () {
......@@ -311,7 +311,7 @@ $(document).ready(function () {
var url = OC.generateUrl(
'/avatar/{user}/{size}',
{user: OC.currentUser, size: 1}
) + '?requesttoken=' + oc_requesttoken;
) + '?requesttoken=' + encodeURIComponent(oc_requesttoken);
$.get(url, function (result) {
if (typeof(result) === 'object') {
$('#removeavatar').hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment