From 48b822bf0dbd951e7d9f5b6e740250eb61e61eec Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Thu, 10 Mar 2016 19:06:02 +0100 Subject: [PATCH] Cast targetPath to String when recovering it from the HTML 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 --- js/breadcrumb.js | 2 +- js/galleryalbum.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/breadcrumb.js b/js/breadcrumb.js index 4896d46555..9f5ea00147 100644 --- a/js/breadcrumb.js +++ b/js/breadcrumb.js @@ -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 diff --git a/js/galleryalbum.js b/js/galleryalbum.js index f65287fb22..ca12e739b4 100644 --- a/js/galleryalbum.js +++ b/js/galleryalbum.js @@ -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);