full_path = full_path + chunk;
$('#breadcrump').append(
- '<li><a uri="' + full_path + '">' + chunk + '</a></li>'
+ '<li><a uri="' + encodeURIComponent(full_path) + '">' + chunk + '</a></li>'
);
full_path += '/';
});
if (current_app !== 'browse' && current_app !== 'search')
break;
- /* The use of encodeURI() below might seem useless, but it's not. It prevents
+ /* The use of encodeURIComponent() below might seem useless, but it's not. It prevents
* some browsers, such as Safari, from changing the normalization form of the
* URI from NFD to NFC, breaking our link with MPD.
+ *
+ * encodeURIComponent() instead of encodeURI() is used to ensure special characters
+ * (like e.g. +) are handled correctly.
*/
if ($('#salamisandwich > tbody').is(':ui-sortable')) {
$('#salamisandwich > tbody').sortable('destroy');
}
$('#salamisandwich > tbody').append(
'<tr uri="' +
- encodeURI(obj.data[item].dir) +
+ encodeURIComponent(obj.data[item].dir) +
'" class="' +
clazz +
'">' +
}
$('#salamisandwich > tbody').append(
'<tr uri="' +
- encodeURI(obj.data[item].plist) +
+ encodeURIComponent(obj.data[item].plist) +
'" class="' +
clazz +
'">' +
$('#salamisandwich > tbody').append(
'<tr uri="' +
- encodeURI(obj.data[item].uri) +
+ encodeURIComponent(obj.data[item].uri) +
'" class="song">' +
'<td><span class="glyphicon glyphicon-music"></span></td>' +
'<td>' +
socket.send(
onClickAction +
',' +
- decodeURI(
+ decodeURIComponent(
$(this).parents('tr').attr('uri')
)
);
case 'song':
socket.send(
'MPD_API_ADD_TRACK,' +
- decodeURI($(this).attr('uri'))
+ decodeURIComponent($(this).attr('uri'))
);
$('.top-right')
.notify({
case 'plist':
socket.send(
'MPD_API_ADD_PLAYLIST,' +
- decodeURI($(this).attr('uri'))
+ decodeURIComponent($(this).attr('uri'))
);
$('.top-right')
.notify({