[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix elFinder CryptPad integration regression
"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a2bcc5d388b9_38306f880243d0@gitlab-sidekiq-low-urgency-cpu-bound-v2-677db6d654-4cp74.mail> |
ushindi bienvenu pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
ea596947 by Moïse Nturubika at 2026-06-12T08:49:38+00:00
[FIX] Fix elFinder CryptPad integration regression
---
* Fix: elFinder CryptPad integration regression on master
See merge request tikiwiki/tiki!10180
- - - - -
1 changed file:
- lib/jquery_tiki/elfinder/tiki-elfinder.js
Changes:
=====================================
lib/jquery_tiki/elfinder/tiki-elfinder.js
=====================================
@@ -27,9 +27,20 @@
}
function extractFileIdFromHash(fm, hash) {
- var fileId = fm.realpath(hash);
- if (fileId && fileId.indexOf('f_') === 0) {
- return fileId.replace('f_', '');
+ if (hash && hash.indexOf('_') !== -1) {
+ var pathPart = hash.split('_')[1];
+ try {
+ var base64 = pathPart.replace(/-/g, '+').replace(/_/g, '/').replace(/\./g, '=');
+ while (base64.length % 4) {
+ base64 += '=';
+ }
+ var decoded = atob(base64);
+ if (decoded && decoded.indexOf('f_') === 0) {
+ return decoded.replace('f_', '');
+ }
+ } catch (e) {
+ // ignore
+ }
}
return null;
}
@@ -54,14 +65,15 @@
}
fm.request({
- data: {cmd: 'tikiFileFromHash', hash: hashes[0]},
- preventDefault: true
+ data: {cmd: 'tikiFileFromHash', 'hash[]': hashes[0] },
+ preventDefault: true,
+ raw: true
})
.always(function(response) {
var fileId, galleryId = null;
+ var data = (response && Array.isArray(response)) ? response[0] : response;
- if (response && (Array.isArray(response) ? response[0] : response).fileId) {
- var data = Array.isArray(response) ? response[0] : response;
+ if (data && data.fileId) {
fileId = data.fileId;
galleryId = data.galleryId;
} else {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ea596947316043982c54d0ee73e1ad5a0e6afa94
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ea596947316043982c54d0ee73e1ad5a0e6afa94
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs