Code Duplication    Length = 3-3 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 6423-6425 (lines=3) @@
6420
            if (!empty($dir[0]) && $dir[0] != '/') {
6421
                $dir = '/'.$dir;
6422
            }
6423
            if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') {
6424
                $dir .= '/';
6425
            }
6426
        } else {
6427
            $parentInfo = DocumentManager::get_document_data_by_id($parentId, $courseInfo['code']);
6428
            if (!empty($parentInfo)) {
@@ 6576-6578 (lines=3) @@
6573
            $dir = '/'.$dir;
6574
        }
6575
6576
        if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') {
6577
            $dir .= '/';
6578
        }
6579
6580
        $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
6581