Code Duplication    Length = 7-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 406-414 (lines=9) @@
403
				$suggested = $this->request->getHeader('X-WOPI-SuggestedTarget');
404
				$suggested = iconv('utf-7', 'utf-8', $suggested);
405
406
				if ($suggested[0] === '.') {
407
					$path = dirname($file->getPath()) . '/New File' . $suggested;
408
				}
409
				else if ($suggested[0] !== '/') {
410
					$path = dirname($file->getPath()) . '/' . $suggested;
411
				}
412
				else {
413
					$path = $userFolder->getPath() . $suggested;
414
				}
415
416
				if ($path === '') {
417
					return new JSONResponse([
@@ 559-565 (lines=7) @@
556
				$suggested = $this->request->getHeader('X-WOPI-SuggestedTarget');
557
				$suggested = iconv('utf-7', 'utf-8', $suggested);
558
559
				if ($suggested[0] === '.') {
560
					$path = dirname($file->getPath()) . '/New File' . $suggested;
561
				} else if ($suggested[0] !== '/') {
562
					$path = dirname($file->getPath()) . '/' . $suggested;
563
				} else {
564
					$path = $userFolder->getPath() . $suggested;
565
				}
566
567
				if ($path === '') {
568
					return new JSONResponse([