Sanitize order and orderby in get_terms()
git-svn-id: http://svn.automattic.com/wordpress/trunk@18344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d3fec0ea9a
commit
581402ae2f
|
@ -1229,6 +1229,8 @@ function &get_terms($taxonomies, $args = '') {
|
||||||
$orderby = '';
|
$orderby = '';
|
||||||
elseif ( empty($_orderby) || 'id' == $_orderby )
|
elseif ( empty($_orderby) || 'id' == $_orderby )
|
||||||
$orderby = 't.term_id';
|
$orderby = 't.term_id';
|
||||||
|
else
|
||||||
|
$orderby = 't.name';
|
||||||
|
|
||||||
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
|
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
|
||||||
|
|
||||||
|
@ -1237,6 +1239,10 @@ function &get_terms($taxonomies, $args = '') {
|
||||||
else
|
else
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
|
$order = strtoupper( $order );
|
||||||
|
if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
|
||||||
|
$order = 'ASC';
|
||||||
|
|
||||||
$where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
|
$where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
|
||||||
$inclusions = '';
|
$inclusions = '';
|
||||||
if ( !empty($include) ) {
|
if ( !empty($include) ) {
|
||||||
|
|
Loading…
Reference in New Issue