Commit 7196aba9 authored by godotislate's avatar godotislate Committed by Damien McKenna
Browse files

Issue #3351181 by godotislate, DamienMcKenna: Missing access checks on entity...

Issue #3351181 by godotislate, DamienMcKenna: Missing access checks on entity queries in metatag_open_graph update hooks.
parent e39397bc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ Metatag 8.x-1.x-dev, 2022-xx-xx
  with Referrer-policy HTTP header.
#3132062 by DamienMcKenna: Updated fixtures with some documentation and todo's.
#3350298 by DamienMcKenna: Backport metatag_data_decode() from v2.
#3351181 by godotislate, DamienMcKenna: Missing access checks on entity queries
  in metatag_open_graph update hooks.


Metatag 8.x-1.22, 2022-09-29
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ function metatag_open_graph_update_8102(&$sandbox) {
          // We found a metatag field, so query for all the entities of this
          // type that have "article_tags" in the serialized array.
          $q = \Drupal::entityQuery($entity_type);
          $q->accessCheck(FALSE);
          $q->condition($field_name, "article_tags", "CONTAINS");
          $count = $q->count()->execute();

@@ -81,6 +82,7 @@ function metatag_open_graph_update_8102(&$sandbox) {

    foreach ($fields as $field_name => $last) {
      $q = \Drupal::entityQuery($entity_type);
      $q->accessCheck(FALSE);
      $q->condition($field_name, "article_tags", "CONTAINS");
      $q->condition($id_col, $last, ">");
      $q->sort($id_col);