Code Duplication    Length = 5-6 lines in 2 locations

apps/files_sharing/lib/controllers/sharecontroller.php 1 location

@@ 318-322 (lines=5) @@
315
			 * The OC_Util methods require a view. This just uses the node API
316
			 */
317
			$freeSpace = $share->getNode()->getStorage()->free_space($share->getNode()->getInternalPath());
318
			if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) {
319
				$freeSpace = max($freeSpace, 0);
320
			} else {
321
				$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
322
			}
323
324
			$uploadLimit = Util::uploadLimit();
325
			$maxUploadFilesize = min($freeSpace, $uploadLimit);

lib/private/helper.php 1 location

@@ 505-510 (lines=6) @@
502
	 */
503
	public static function freeSpace($dir) {
504
		$freeSpace = \OC\Files\Filesystem::free_space($dir);
505
		if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) {
506
			$freeSpace = max($freeSpace, 0);
507
			return $freeSpace;
508
		} else {
509
			return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
510
		}
511
	}
512
513
	/**