Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/modules/comment/views_handler_sort_comment_thread.inc
11 11
 * @ingroup views_sort_handlers
12 12
 */
13 13
class views_handler_sort_comment_thread extends views_handler_sort {
14
  function query() {
14

  
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function query() {
15 19
    $this->ensure_my_table();
16 20

  
17
    //Read comment_render() in comment.module for an explanation of the
18
    //thinking behind this sort.
21
    // Read comment_render() in comment.module for an explanation of the
22
    // thinking behind this sort.
19 23
    if ($this->options['order'] == 'DESC') {
20 24
      $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
21 25
    }
22 26
    else {
23 27
      $alias = $this->table_alias . '_' . $this->real_field . 'asc';
24
      //@todo is this secure?
28
      // @todo Is this secure?
25 29
      $this->query->add_orderby(NULL, "SUBSTRING({$this->table_alias}.{$this->real_field}, 1, (LENGTH({$this->table_alias}.{$this->real_field}) - 1))", $this->options['order'], $alias);
26 30
    }
27 31
  }
32

  
28 33
}

Formats disponibles : Unified diff