Project

General

Profile

Revision b0dc3a2e

Added by Julien Enselme over 7 years ago

Update to Drupal 7.52

View differences:

drupal7/includes/database/select.inc
1231 1231

  
1232 1232
    // Modules may alter all queries or only those having a particular tag.
1233 1233
    if (isset($this->alterTags)) {
1234
      // Many contrib modules assume that query tags used for access-checking
1235
      // purposes follow the pattern $entity_type . '_access'. But this is
1236
      // not the case for taxonomy terms, since core used to add term_access
1237
      // instead of taxonomy_term_access to its queries. Provide backwards
1238
      // compatibility by adding both tags here instead of attempting to fix
1239
      // all contrib modules in a coordinated effort.
1240
      // TODO:
1241
      // - Extract this mechanism into a hook as part of a public (non-security)
1242
      //   issue.
1243
      // - Emit E_USER_DEPRECATED if term_access is used.
1244
      //   https://www.drupal.org/node/2575081
1245
      $term_access_tags = array('term_access' => 1, 'taxonomy_term_access' => 1);
1246
      if (array_intersect_key($this->alterTags, $term_access_tags)) {
1247
        $this->alterTags += $term_access_tags;
1248
      }
1234 1249
      $hooks = array('query');
1235 1250
      foreach ($this->alterTags as $tag => $value) {
1236 1251
        $hooks[] = 'query_' . $tag;

Also available in: Unified diff