Code Duplication    Length = 4-7 lines in 2 locations

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

lib/private/Share/Share.php 1 location

@@ 475-478 (lines=4) @@
472
			return true;
473
		}
474
475
		if (\OC::$server->getSession()->exists('public_link_authenticated')
476
			&& \OC::$server->getSession()->get('public_link_authenticated') === (string)$linkItem['id']) {
477
			return true;
478
		}
479
480
		return false;
481
	}