Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 270-278 (lines=9) @@
267
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkSecure', 'no') === 'yes' && $wopi->getHideDownload()) {
268
				return true;
269
			}
270
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkTags', 'no') === 'yes') {
271
				$tags = $this->appConfig->getAppValueArray('watermark_linkTagsList');
272
				$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
273
				foreach ($fileTags as $tagId) {
274
					if (in_array($tagId, $tags, true)) {
275
						return true;
276
					}
277
				}
278
			}
279
		} else {
280
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
281
				$files = $this->rootFolder->getUserFolder($userId)->getById($fileId);
@@ 298-306 (lines=9) @@
295
				}
296
			}
297
		}
298
		if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allTags', 'no') === 'yes') {
299
			$tags = $this->appConfig->getAppValueArray('watermark_allTagsList');
300
			$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
301
			foreach ($fileTags as $tagId) {
302
				if (in_array($tagId, $tags, true)) {
303
					return true;
304
				}
305
			}
306
		}
307
308
		return false;
309
	}