Code Duplication    Length = 4-7 lines in 2 locations

lib/private/Share/Share.php 1 location

@@ 494-497 (lines=4) @@
491
			return true;
492
		}
493
494
		if (\OC::$server->getSession()->exists('public_link_authenticated')
495
			&& \OC::$server->getSession()->get('public_link_authenticated') === (string)$linkItem['id']) {
496
			return true;
497
		}
498
499
		return false;
500
	}

apps/files_sharing/lib/Helper.php 1 location

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