Code Duplication    Length = 17-17 lines in 2 locations

lib/private/share/share.php 2 locations

@@ 177-193 (lines=17) @@
174
			}
175
176
			//check for public link shares
177
			if (!$publicShare) {
178
				$query = \OC_DB::prepare('
179
					SELECT `share_with`
180
					FROM `*PREFIX*share`
181
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
182
				);
183
184
				$result = $query->execute(array($source, self::SHARE_TYPE_LINK));
185
186
				if (\OCP\DB::isError($result)) {
187
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
188
				} else {
189
					if ($result->fetchRow()) {
190
						$publicShare = true;
191
					}
192
				}
193
			}
194
195
			//check for remote share
196
			if (!$remoteShare) {
@@ 196-212 (lines=17) @@
193
			}
194
195
			//check for remote share
196
			if (!$remoteShare) {
197
				$query = \OC_DB::prepare('
198
					SELECT `share_with`
199
					FROM `*PREFIX*share`
200
					WHERE `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')', 1
201
				);
202
203
				$result = $query->execute(array($source, self::SHARE_TYPE_REMOTE));
204
205
				if (\OCP\DB::isError($result)) {
206
					\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
207
				} else {
208
					if ($result->fetchRow()) {
209
						$remoteShare = true;
210
					}
211
				}
212
			}
213
214
			// let's get the parent for the next round
215
			$meta = $cache->get((int)$source);