Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 257-265 (lines=9) @@
254
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkSecure', 'no') === 'yes' && $wopi->getHideDownload()) {
255
				return true;
256
			}
257
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkTags', 'no') === 'yes') {
258
				$tags = $this->appConfig->getAppValueArray('watermark_linkTagsList');
259
				$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
260
				foreach ($fileTags as $tagId) {
261
					if (in_array($tagId, $tags, true)) {
262
						return true;
263
					}
264
				}
265
			}
266
		} else {
267
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
268
				$files = $this->rootFolder->getUserFolder($userId)->getById($fileId);
@@ 285-293 (lines=9) @@
282
				}
283
			}
284
		}
285
		if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allTags', 'no') === 'yes') {
286
			$tags = $this->appConfig->getAppValueArray('watermark_allTagsList');
287
			$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
288
			foreach ($fileTags as $tagId) {
289
				if (in_array($tagId, $tags, true)) {
290
					return true;
291
				}
292
			}
293
		}
294
295
		return false;
296
	}