Code Duplication    Length = 10-10 lines in 2 locations

programs/caldav.class.php 2 locations

@@ 792-801 (lines=10) @@
789
					}
790
				}
791
792
				if ($period->getProperty('RRULE') !== '') {
793
					$rrule = new RRule($icalStart, $period->getProperty('RRULE'));
794
795
					// We add an element to $recurrenceDates for each date defined by the recurrence rule.
796
					while (($dtStart = $rrule->GetNext()) && ($dtStart->_text < $expandEnd)) {
797
						if ($dtStart->_text >= $expandStart) {
798
							$recurrenceDates[$dtStart->_text] = $dtStart->_text;
799
						}
800
					}
801
				}
802
803
				// Now we use EXDATE and EXRULE parameters to determine a list
804
				// of date excluded from the recurrence rule.
@@ 815-824 (lines=10) @@
812
					}
813
				}
814
815
				if ($period->getProperty('EXRULE') !== '') {
816
					$exrule = new RRule($icalStart, $period->getProperty('EXRULE'));
817
818
					// We remove an element from $recurrenceDates for each date defined by the recurrence rule.
819
					while (($dtStart = $exrule->GetNext()) && ($dtStart->_text < $expandEnd)) {
820
						if ($dtStart->_text >= $expandStart) {
821
							unset($recurrenceDates[$dtStart->_text]);
822
						}
823
					}
824
				}
825
826
				// Finally we create a period for each date remaining in $recurrenceDates.
827