WordPress.org

Make WordPress Core

Changeset 18344


Ignore:
Timestamp:
06/27/2011 03:45:12 PM (7 years ago)
Author:
ryan
Message:

Sanitize order and orderby in get_terms()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r18254 r18344  
    12301230    elseif ( empty($_orderby) || 'id' == $_orderby )
    12311231        $orderby = 't.term_id';
     1232    else
     1233        $orderby = 't.name';
    12321234
    12331235    $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
     
    12371239    else
    12381240        $order = '';
     1241
     1242    $order = strtoupper( $order );
     1243    if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
     1244        $order = 'ASC';
    12391245
    12401246    $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
Note: See TracChangeset for help on using the changeset viewer.