WordPress.org

Make WordPress Core

Changeset 28087


Ignore:
Timestamp:
04/12/2014 07:03:56 PM (6 years ago)
Author:
nacin
Message:

User Query: Don't blindly re-append new meta queries for capabilities.

fixes #21119.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r28015 r28087  
    666666            }
    667667
    668             $qv['meta_query'][] = $cap_meta_query;
     668            if ( empty( $qv['meta_query'] ) || ! in_array( $cap_meta_query, $qv['meta_query'], true ) ) {
     669                $qv['meta_query'][] = $cap_meta_query;
     670            }
    669671        }
    670672
  • trunk/tests/phpunit/tests/user/query.php

    r27185 r28087  
    102102    }
    103103
     104    /**
     105     * @ticket 21119
     106     */
    104107    function test_prepare_query() {
    105108        $query = new WP_User_Query();
Note: See TracChangeset for help on using the changeset viewer.