Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 395-403 (lines=9) @@
392
				$suggested = $this->request->getHeader('X-WOPI-SuggestedTarget');
393
				$suggested = iconv('utf-7', 'utf-8', $suggested);
394
395
				if ($suggested[0] === '.') {
396
					$path = dirname($file->getPath()) . '/New File' . $suggested;
397
				}
398
				else if ($suggested[0] !== '/') {
399
					$path = dirname($file->getPath()) . '/' . $suggested;
400
				}
401
				else {
402
					$path = $userFolder->getPath() . $suggested;
403
				}
404
405
				if ($path === '') {
406
					return new JSONResponse([
@@ 546-554 (lines=9) @@
543
				$suggested = $this->request->getHeader('X-WOPI-SuggestedTarget');
544
				$suggested = iconv('utf-7', 'utf-8', $suggested);
545
546
				if ($suggested[0] === '.') {
547
					$path = dirname($file->getPath()) . '/New File' . $suggested;
548
				} else if ($suggested[0] !== '/') {
549
					$path = dirname($file->getPath()) . '/' . $suggested;
550
				} else {
551
					$path = $userFolder->getPath() . $suggested;
552
				}
553
554
				if ($path === '') {
555
					return new JSONResponse([
556
						'status' => 'error',
557
						'message' => 'Cannot create the file'