Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityStorageBase.php
index 99698df0ae21986df51086fe88cc960dc9797c6f..e5bf880aef2a89ffd259649cdfb08e8fcc756608 100644 (file)
@@ -499,11 +499,22 @@ abstract class EntityStorageBase extends EntityHandlerBase implements EntityStor
   public function loadByProperties(array $values = []) {
     // Build a query to fetch the entity IDs.
     $entity_query = $this->getQuery();
+    $entity_query->accessCheck(FALSE);
     $this->buildPropertyQuery($entity_query, $values);
     $result = $entity_query->execute();
     return $result ? $this->loadMultiple($result) : [];
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function hasData() {
+    return (bool) $this->getQuery()
+      ->accessCheck(FALSE)
+      ->range(0, 1)
+      ->execute();
+  }
+
   /**
    * {@inheritdoc}
    */