Code Duplication    Length = 5-5 lines in 2 locations

main/coursecopy/classes/CourseRestorer.class.php 2 locations

@@ 603-607 (lines=5) @@
600
								}
601
								$new_file_name = $file_name_no_ext.'_'.$i.$ext;
602
								$file_exists = file_exists($path.$new_file_name);
603
								while ($file_exists) {
604
									$i ++;
605
									$new_file_name = $file_name_no_ext.'_'.$i.$ext;
606
									$file_exists = file_exists($path.$new_file_name);
607
								}
608
609
								if (!empty($session_id)) {
610
@@ 991-995 (lines=5) @@
988
							$new_file_name = $file_name_no_ext.'_'.$i.$ext;
989
							$file_exists = file_exists($path.$new_file_name);
990
991
							while ($file_exists) {
992
								$i ++;
993
								$new_file_name = $file_name_no_ext.'_'.$i.$ext;
994
								$file_exists = file_exists($path.$new_file_name);
995
							}
996
997
                            rename(
998
                                $this->course->backup_path . '/' . $document->path,