Code Duplication    Length = 17-17 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 268-284 (lines=17) @@
265
			}
266
267
			//check for public link shares
268
			if (!$publicShare) {
269
				$query = \OC_DB::prepare('
270
					SELECT `share_with`
271
					FROM `*PREFIX*share`
272
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
273
				);
274
275
				$result = $query->execute(array($source, self::SHARE_TYPE_LINK));
276
277
				if (\OCP\DB::isError($result)) {
278
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
279
				} else {
280
					if ($result->fetchRow()) {
281
						$publicShare = true;
282
					}
283
				}
284
			}
285
286
			//check for remote share
287
			if (!$remoteShare) {
@@ 287-303 (lines=17) @@
284
			}
285
286
			//check for remote share
287
			if (!$remoteShare) {
288
				$query = \OC_DB::prepare('
289
					SELECT `share_with`
290
					FROM `*PREFIX*share`
291
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
292
				);
293
294
				$result = $query->execute(array($source, self::SHARE_TYPE_REMOTE));
295
296
				if (\OCP\DB::isError($result)) {
297
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
298
				} else {
299
					if ($result->fetchRow()) {
300
						$remoteShare = true;
301
					}
302
				}
303
			}
304
305
			// let's get the parent for the next round
306
			$meta = $cache->get((int)$source);