Code Duplication    Length = 17-17 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 206-222 (lines=17) @@
203
			}
204
205
			//check for public link shares
206
			if (!$publicShare) {
207
				$query = \OC_DB::prepare('
208
					SELECT `share_with`
209
					FROM `*PREFIX*share`
210
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
211
				);
212
213
				$result = $query->execute([$source, self::SHARE_TYPE_LINK]);
214
215
				if (\OCP\DB::isError($result)) {
216
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
217
				} else {
218
					if ($result->fetchRow()) {
219
						$publicShare = true;
220
					}
221
				}
222
			}
223
224
			//check for remote share
225
			if (!$remoteShare) {
@@ 225-241 (lines=17) @@
222
			}
223
224
			//check for remote share
225
			if (!$remoteShare) {
226
				$query = \OC_DB::prepare('
227
					SELECT `share_with`
228
					FROM `*PREFIX*share`
229
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
230
				);
231
232
				$result = $query->execute([$source, self::SHARE_TYPE_REMOTE]);
233
234
				if (\OCP\DB::isError($result)) {
235
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
236
				} else {
237
					if ($result->fetchRow()) {
238
						$remoteShare = true;
239
					}
240
				}
241
			}
242
243
			// let's get the parent for the next round
244
			$meta = $cache->get((int)$source);