Skip to content

Commit

Permalink
Cast targetPath to String when recovering it from the HTML
Browse files Browse the repository at this point in the history
HTML5 data properties can be anything and if a folder only contains numbers as its name it will be considered a number and String operations will fail
  • Loading branch information
oparoz committed Mar 10, 2016
1 parent 97a8c88 commit 48b822b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
if (!$target.is('.crumb')) {
$target = $target.closest('.crumb');
}
var targetPath = $(event.target).data('dir');
var targetPath = $(event.target).data('dir').toString();
var dir = Gallery.currentAlbum;

while (dir.substr(0, 1) === '/') {//remove extra leading /'s
Expand Down
2 changes: 1 addition & 1 deletion js/galleryalbum.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
var $item = ui.draggable;
var $clone = ui.helper;
var $target = $(event.target);
var targetPath = $target.data('dir');
var targetPath = $target.data('dir').toString();
var filePath = $item.data('path');
var fileName = OC.basename(filePath);

Expand Down

0 comments on commit 48b822b

Please sign in to comment.