Code Duplication    Length = 11-11 lines in 2 locations

apps/dav/lib/CalDAV/CalDavBackend.php 1 location

@@ 289-299 (lines=11) @@
286
			}
287
288
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
289
			if (isset($calendars[$row['id']])) {
290
				if ($readOnly) {
291
					// New share can not have more permissions then the old one.
292
					continue;
293
				}
294
				if (isset($calendars[$row['id']][$readOnlyPropertyName]) &&
295
					$calendars[$row['id']][$readOnlyPropertyName] === 0) {
296
					// Old share is already read-write, no more permissions can be gained
297
					continue;
298
				}
299
			}
300
301
			list(, $name) = URLUtil::splitPath($row['principaluri']);
302
			$uri = $row['uri'] . '_shared_by_' . $name;

apps/dav/lib/CardDAV/CardDavBackend.php 1 location

@@ 184-194 (lines=11) @@
181
			}
182
183
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
184
			if (isset($addressBooks[$row['id']])) {
185
				if ($readOnly) {
186
					// New share can not have more permissions then the old one.
187
					continue;
188
				}
189
				if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
190
					$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
191
					// Old share is already read-write, no more permissions can be gained
192
					continue;
193
				}
194
			}
195
196
			list(, $name) = URLUtil::splitPath($row['principaluri']);
197
			$uri = $row['uri'] . '_shared_by_' . $name;