Skip to content

Commit 41b3b64

Browse files
committed
MOBILE-1701 assign: Fix file URLs without slash mode
1 parent f266bfa commit 41b3b64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

www/core/lib/text.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ angular.module('mm.core')
483483
self.getTextPluginfileUrl = function(files) {
484484
if (files && files.length) {
485485
var fileURL = files[0].fileurl;
486-
return fileURL.substr(0, fileURL.lastIndexOf('/')).replace('pluginfile.php/', 'pluginfile.php?file=/');
486+
// Remove text after last slash (encoded or not).
487+
return fileURL.substr(0, Math.max(fileURL.lastIndexOf('/'), fileURL.lastIndexOf('%2F')));
487488
}
488489

489490
return false;

0 commit comments

Comments
 (0)