I've got a subdomain then I need use relative url

thanks to https://www.drupal.org/node/2437939

but further changes are needed :

in module
ckeditor.kcfinder.module

line 87
// $default_upload_url = $base_url . '/' . $file_public_path;
$default_upload_url = $file_public_path;

line 191
$libPathBase = preg_replace($GLOBALS['base_path'],'/',$libPathBase);

line 210
/* src https://www.drupal.org/node/2437939 */
// Figure out the kcfinder_upload_dir based on the kcfinder_upload_url by replacing the URL with the installation path.
// $path = preg_replace('/(https?:\/\/+[^\/]+)/', $drupal_root, $url);

// Figure out the kcfinder_upload_dir based on the kcfinder_upload_url by removing the domain portion, if it exists, and replacing with drupal root path.
$path = preg_replace('/(https?:\/\/+[^\/]+)/', '', $url);
$path = $drupal_root . '/' . ltrim($path, '/');

libraries/kcfinder/js/080files.js
line 168
fileURL = fileURL.replace('sites/all/libraries/kcfinder/','');

Comments

cravecode’s picture

Thanks @JFH, I'll try to look into it over the weekend.