From bbadd46b4c09d00739e0d48943617f4d49d006db Mon Sep 17 00:00:00 2001 From: Akanksha Date: Fri, 18 Oct 2024 15:17:54 +0530 Subject: [PATCH] DDST-593: Hardening --- src/Plugin/Block/DisplayCitationsBlock.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Plugin/Block/DisplayCitationsBlock.php b/src/Plugin/Block/DisplayCitationsBlock.php index a422895..ae19e99 100644 --- a/src/Plugin/Block/DisplayCitationsBlock.php +++ b/src/Plugin/Block/DisplayCitationsBlock.php @@ -11,6 +11,7 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\islandora_citations\IslandoraCitationsHelper; +use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -177,7 +178,7 @@ public function blockSubmit($form, FormStateInterface $form_state) { public function getCacheTags() { // Retrieve the node ID. $node = $this->routeMatch->getParameter('node'); - $node_id = $node ? $node->id() : NULL; + $node_id = $node instanceof NodeInterface ? $node->id() : NULL; // Return cache tags. if ($node_id) {