Code Duplication    Length = 3-3 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 6375-6377 (lines=3) @@
6372
            if (!empty($dir[0]) && $dir[0] != '/') {
6373
                $dir = '/'.$dir;
6374
            }
6375
            if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') {
6376
                $dir .= '/';
6377
            }
6378
        } else {
6379
            $parentInfo = DocumentManager::get_document_data_by_id($parentId, $courseInfo['code']);
6380
            if (!empty($parentInfo)) {
@@ 6528-6530 (lines=3) @@
6525
            $dir = '/'.$dir;
6526
        }
6527
6528
        if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') {
6529
            $dir .= '/';
6530
        }
6531
6532
        $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
6533