WordPress.org

Make WordPress Core

Changeset 18354


Ignore:
Timestamp:
06/27/2011 09:35:13 PM (10 years ago)
Author:
ryan
Message:

Sanitize order and orderby in get_terms(). For 3.1

Location:
branches/3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1

  • branches/3.1/wp-includes/taxonomy.php

    r18021 r18354  
    11951195    elseif ( empty($_orderby) || 'id' == $_orderby )
    11961196        $orderby = 't.term_id';
     1197    else
     1198        $orderby = 't.name';
    11971199
    11981200    $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
     
    12021204    else
    12031205        $order = '';
     1206
     1207    $order = strtoupper( $order );
     1208    if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
     1209        $order = 'ASC';
    12041210
    12051211    $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
Note: See TracChangeset for help on using the changeset viewer.