From 4c046f43af85d197fca40dc112687b9a69395ed5 Mon Sep 17 00:00:00 2001 From: Julien Loizelet Date: Thu, 25 Jan 2024 15:27:53 +0900 Subject: [PATCH] fix(2.3): Disable phpcs Magento2.Legacy.EscapeMethodsOnBlockClass for some templates --- .../templates/report/events-list-title.phtml | 8 +++- view/adminhtml/templates/report/metrics.phtml | 42 ++++++++++--------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/view/adminhtml/templates/report/events-list-title.phtml b/view/adminhtml/templates/report/events-list-title.phtml index 9957c37..9bd1378 100644 --- a/view/adminhtml/templates/report/events-list-title.phtml +++ b/view/adminhtml/templates/report/events-list-title.phtml @@ -24,13 +24,17 @@ * @author CrowdSec team * */ +/** + * + * @phpcs:disable Magento2.Legacy.EscapeMethodsOnBlockClass + * + */ /** @var \Magento\Backend\Block\Template $block */ -/** @var \Magento\Framework\Escaper $escaper */ ?>
-

escapeHtml(__('Detected events list'))?>

+

escapeHtml(__('Detected events list'))?>

diff --git a/view/adminhtml/templates/report/metrics.phtml b/view/adminhtml/templates/report/metrics.phtml index ba88d77..8b30f48 100644 --- a/view/adminhtml/templates/report/metrics.phtml +++ b/view/adminhtml/templates/report/metrics.phtml @@ -24,9 +24,13 @@ * @author CrowdSec team * */ +/** + * + * @phpcs:disable Magento2.Legacy.EscapeMethodsOnBlockClass + * + */ /** @var \CrowdSec\Engine\Block\Adminhtml\Report\Metrics $block */ -/** @var \Magento\Framework\Escaper $escaper */ ?>
-

escapeHtml(__('Metrics')) ?>

+

escapeHtml(__('Metrics')) ?>

-

escapeHtml(__('Current bouncing behaviors settings')) ?>

+

escapeHtml(__('Current bouncing behaviors settings')) ?>

  • isLocalBanEnabled()): ?> escapeHtml( + $block->escapeHtml( __('Ban IP locally enabled → When a Magento scenario triggers an alert, IP is banned locally.'), ['i','a','b'] @@ -49,7 +53,7 @@ ?> escapeHtml( + $block->escapeHtml( __('Ban IP locally disabled → When a Magento scenario triggers an alert, IP is not banned locally.'), ['i','a','b'] @@ -59,14 +63,14 @@
  • isBanBouncingEnabled()): ?> escapeHtml( + $block->escapeHtml( __('Block banned IP enabled → Access is currently blocked for banned IP addresses.'), ['i','a','b'] ) ?> escapeHtml( + $block->escapeHtml( __('Block banned IP disabled → Access is currently allowed for banned IP addresses.'), ['i','a','b'] @@ -74,14 +78,14 @@
-

escapeHtml(__( +

escapeHtml(__( 'You can change these behaviors by modifying decisions settings here.', $block->getSettingsUrl() .'#crowdsec_engine_decisions-link' ), ['i','a','b']) ?>

-

escapeHtml(__('Decision metrics')) ?>(1)

+

escapeHtml(__('Decision metrics')) ?>(1)

@@ -89,39 +93,39 @@ - escapeHtml(__('Origin of the decision')) ?> + escapeHtml(__('Origin of the decision')) ?> - escapeHtml(__('Count')) ?> + escapeHtml(__('Count')) ?> - escapeHtml(__('CrowdSec Engine extension (Local decision)')) ?> + escapeHtml(__('CrowdSec Engine extension (Local decision)')) ?> - escapeHtml($origins[$block->getOriginCrowdsec()] ?? 0) ?> + escapeHtml($origins[$block->getOriginCrowdsec()] ?? 0) ?> - escapeHtml(__('CrowdSec Community blocklist')) ?> - escapeHtml($origins[$block->getOriginCapi()] ?? 0) ?> + escapeHtml(__('CrowdSec Community blocklist')) ?> + escapeHtml($origins[$block->getOriginCapi()] ?? 0) ?> - escapeHtml(__('Subscribed third-party blocklists')) ?> - escapeHtml($origins[$block->getOriginLists()] ?? 0) ?> + escapeHtml(__('Subscribed third-party blocklists')) ?> + escapeHtml($origins[$block->getOriginLists()] ?? 0) ?>

1. - escapeHtml( + escapeHtml( __('This module stores CrowdSec decision metrics only if the Block banned IP setting is enabled.'), ['i'] ) ?>
escapeHtml( + $block->escapeHtml( __('As this information is stored in cache, it will be reset if you clear the CrowdSec Engine cache.') )?>