Sanitize order and orderby in get_terms()

git-svn-id: https://develop.svn.wordpress.org/trunk@18344 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-06-27 15:45:12 +00:00
parent c3f3ade632
commit bb7af108f5
1 changed files with 6 additions and 0 deletions

View File

@ -1229,6 +1229,8 @@ function &get_terms($taxonomies, $args = '') {
$orderby = '';
elseif ( empty($_orderby) || 'id' == $_orderby )
$orderby = 't.term_id';
else
$orderby = 't.name';
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
@ -1237,6 +1239,10 @@ function &get_terms($taxonomies, $args = '') {
else
$order = '';
$order = strtoupper( $order );
if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
$order = 'ASC';
$where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
$inclusions = '';
if ( !empty($include) ) {