Commit 727fd25e authored by colemanw's avatar colemanw
Browse files

Use CRM.url() for ELFinder url in js, htmlize => FALSE in PHP

The core function was causing bugs in Wordpress due to the html encoding.
I could have updated both places but the CRM.url() function seems simpler.
parent 652864cf
......@@ -30,7 +30,7 @@ class CRM_Ckeditor5_Page_ImageManager extends CRM_Core_Page {
// define('ELFINDER_JPEGTRAN_PATH', '/PATH/TO/jpegtran');
// define('ELFINDER_FFMPEG_PATH', '/PATH/TO/ffmpeg');
define('ELFINDER_CONNECTOR_URL', CRM_Utils_System::url('civicrm/image/access'));
define('ELFINDER_CONNECTOR_URL', CRM_Utils_System::url('civicrm/image/access', NULL, TRUE, NULL, FALSE, FALSE, TRUE));
// see elFinder::getConnectorUrl()
// define('ELFINDER_DEBUG_ERRORLEVEL', -1); // Error reporting level of debug mode
......
......@@ -165,7 +165,6 @@ function ckeditor5_civicrm_coreResourceList(&$items, $region) {
// build so no build in the path.
'CKEditor5Location' => CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/ckeditor5/ckeditor-classic-build/ckeditor.js'),
'ELFinderLocation' => CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/elFinder/js/elfinder.min.js'),
'ELFinderConnnector' => CRM_Utils_System::url('civicrm/image/access'),
],
];
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/elFinder/css/elfinder.min.css'));
......@@ -180,7 +179,6 @@ function ckeditor5_civicrm_coreResourceList(&$items, $region) {
// build so no build in the path.
'CKEditor5Location' => CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/ckeditor5/ckeditor-base64-upload-adapter/build/ckeditor.js'),
'ELFinderLocation' => NULL,
'ELFinderConnnector' => NULL,
],
];
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'css/ckeditor.css'));
......
......@@ -28,7 +28,7 @@
// elfinder folder hash of the destination folder to be uploaded in this CKeditor 5
const uploadTargetHash = 'l1_Lw';
// elFinder connector URL
const connectorUrl = CRM.config.ELFinderConnnector;
const connectorUrl = CRM.url('civicrm/image/access', null, 'back');
const ckf = editor.commands.get('ckfinder'),
fileRepo = editor.plugins.get('FileRepository'),
ntf = editor.plugins.get('Notification'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment