X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=atutor.git;a=blobdiff_plain;f=docs%2Fmods%2F_core%2Fimscp%2Fims_import.php;h=103163e6929396d95e3282e7ba5f67602655dcc2;hp=a162fe5b177871c8e325122834a419ae14468317;hb=789f48aa8be76938d529dca2aaa5e3352b2c090e;hpb=42b359cc60c6c613260372557c3538da471f25f5 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 @@ foreach ($items as $item_id => $content_info) $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'];