We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f266bfa commit 41b3b64Copy full SHA for 41b3b64
www/core/lib/text.js
@@ -483,7 +483,8 @@ angular.module('mm.core')
483
self.getTextPluginfileUrl = function(files) {
484
if (files && files.length) {
485
var fileURL = files[0].fileurl;
486
- return fileURL.substr(0, fileURL.lastIndexOf('/')).replace('pluginfile.php/', 'pluginfile.php?file=/');
+ // Remove text after last slash (encoded or not).
487
+ return fileURL.substr(0, Math.max(fileURL.lastIndexOf('/'), fileURL.lastIndexOf('%2F')));
488
}
489
490
return false;
0 commit comments