Code Duplication    Length = 8-8 lines in 2 locations

programs/calendarperiod.class.php 2 locations

@@ 104-111 (lines=8) @@
101
102
	static private function getPropertyValue($name, $value)
103
	{
104
		if ($name === 'DESCRIPTION') {
105
			// From RFC 2445 :  \\ encodes \, \N or \n encodes newline,  \; encodes ;, \, encodes ,
106
			$value = str_replace('\\', '\\\\', $value);
107
			$value = str_replace(';', '\;', $value);
108
			$value = str_replace(',', '\,', $value);
109
			$value = str_replace("\n", '\n', $value);
110
			$value = str_replace("\r", '', $value);
111
		}
112
		if ($name === 'DTSTART' || $name === 'DTEND' || $name === 'RDATE' || $name === 'EXDATE' || $name === 'RECURRENCE-ID;VALUE=DATE-TIME') {
113
		    $name .= ';TZID=' . Func_CalendarBackend_Caldav::getTimezoneName();
114
		}
@@ 511-518 (lines=8) @@
508
509
			//			var_dump($icalProperty);
510
			if (trim($iCalPropertyValue) !== '') {
511
				if ($icalPropertyStart === 'DESCRIPTION') {
512
					// From RFC 2445 :  \\ encodes \, \N or \n encodes newline,  \; encodes ;, \, encodes ,
513
					$iCalPropertyValue = str_replace('\\', '\\\\', $iCalPropertyValue);
514
					$iCalPropertyValue = str_replace(';', '\;', $iCalPropertyValue);
515
					$iCalPropertyValue = str_replace(',', '\,', $iCalPropertyValue);
516
					$iCalPropertyValue = str_replace("\n", '\n', $iCalPropertyValue);
517
					$iCalPropertyValue = str_replace("\r", '', $iCalPropertyValue);
518
				}
519
520
				$icalProperty = $iCalPropertyName . ':' . $iCalPropertyValue;
521