diff --git a/docs/mods/_core/imscp/ims_import.php b/docs/mods/_core/imscp/ims_import.php index a162fe5b1..103163e69 100644 --- a/docs/mods/_core/imscp/ims_import.php +++ b/docs/mods/_core/imscp/ims_import.php @@ -1222,7 +1222,11 @@ function glossaryCharacterData($parser, $data){ $all_package_base_path = implode('/', $all_package_base_path); } - if ($common_path != '' && substr($content_info['new_path'], strlen($common_path))) { + // The following condition checks if there is a common path, if so, remove it from the content base_href. + // This prevents the path to grow longer. + if ($common_path != '' + && ($content_info['new_path'] === $common_path + || substr($content_info['new_path'], strlen($common_path)))) { $content_info['new_path'] = $package_base_name . substr($content_info['new_path'], strlen($common_path)); } else { $content_info['new_path'] = $package_base_name . '/' . $content_info['new_path'];