Code Duplication    Length = 4-7 lines in 2 locations

apps/files_sharing/lib/Helper.php 1 location

@@ 153-159 (lines=7) @@
150
					.' for share id '.$linkItem['id'], \OCP\Util::ERROR);
151
				return false;
152
			}
153
		} else {
154
			// not authenticated ?
155
			if (! \OC::$server->getSession()->exists('public_link_authenticated')
156
				|| \OC::$server->getSession()->get('public_link_authenticated') !== (string)$linkItem['id']) {
157
				return false;
158
			}
159
		}
160
		return true;
161
	}
162

lib/private/Share/Share.php 1 location

@@ 2494-2497 (lines=4) @@
2491
			return true;
2492
		}
2493
2494
		if (\OC::$server->getSession()->exists('public_link_authenticated')
2495
			&& \OC::$server->getSession()->get('public_link_authenticated') === (string)$linkItem['id']) {
2496
			return true;
2497
		}
2498
2499
		return false;
2500
	}