Code Duplication    Length = 17-17 lines in 2 locations

src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php 2 locations

@@ 721-737 (lines=17) @@
718
                                        copy($path.$document->path, $path.$new_file_name);
719
                                    }
720
                                    //Replace old course code with the new destination code see BT#1985
721
                                    if (file_exists($path.$new_file_name)) {
722
                                        $file_info = pathinfo($path.$new_file_name);
723
                                        if (in_array($file_info['extension'], array('html', 'htm'))) {
724
                                            $content = file_get_contents($path.$new_file_name);
725
                                            if (UTF8_CONVERT) {
726
                                                $content = utf8_encode($content);
727
                                            }
728
                                            $content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
729
                                                $content,
730
                                                $this->course->code,
731
                                                $this->course->destination_path,
732
                                                $this->course->backup_path,
733
                                                $this->course->info['path']
734
                                            );
735
                                            file_put_contents($path.$new_file_name, $content);
736
                                        }
737
                                    }
738
739
                                    $params = [
740
                                        'path' => "/".self::DBUTF8escapestring(substr($new_file_name, 9)),
@@ 787-803 (lines=17) @@
784
                                );
785
786
                                // Replace old course code with the new destination code see BT#1985
787
                                if (file_exists($path.$new_file_name)) {
788
                                    $file_info = pathinfo($path.$new_file_name);
789
                                    if (in_array($file_info['extension'], array('html', 'htm'))) {
790
                                        $content = file_get_contents($path.$new_file_name);
791
                                        if (UTF8_CONVERT) {
792
                                            $content = utf8_encode($content);
793
                                        }
794
                                        $content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
795
                                            $content,
796
                                            $this->course->code,
797
                                            $this->course->destination_path,
798
                                            $this->course->backup_path,
799
                                            $this->course->info['path']
800
                                        );
801
                                        file_put_contents($path.$new_file_name, $content);
802
                                    }
803
                                }
804
805
                                $params = [
806
                                    'c_id' => $this->destination_course_id,