diff --git a/wp-includes/query.php b/wp-includes/query.php
index 04286aa..a4c6cc8 100644
a
|
b
|
class WP_Query { |
1387 | 1387 | , 'tag' |
1388 | 1388 | , 'cat' |
1389 | 1389 | , 'tag_id' |
| 1390 | , 'author' |
1390 | 1391 | , 'author_name' |
1391 | 1392 | , 'feed' |
1392 | 1393 | , 'tb' |
… |
… |
class WP_Query { |
1407 | 1408 | } |
1408 | 1409 | |
1409 | 1410 | $array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', |
1410 | | 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in' ); |
| 1411 | 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in', |
| 1412 | 'author__in', 'author__not_in' ); |
1411 | 1413 | |
1412 | 1414 | foreach ( $array_keys as $key ) { |
1413 | 1415 | if ( !isset($array[$key]) ) |
… |
… |
class WP_Query { |
1448 | 1450 | $qv['m'] = absint($qv['m']); |
1449 | 1451 | $qv['paged'] = absint($qv['paged']); |
1450 | 1452 | $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers |
| 1453 | $qv['author'] = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers |
1451 | 1454 | $qv['pagename'] = trim( $qv['pagename'] ); |
1452 | 1455 | $qv['name'] = trim( $qv['name'] ); |
1453 | 1456 | if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']); |
… |
… |
class WP_Query { |
2299 | 2302 | } |
2300 | 2303 | |
2301 | 2304 | // Author/user stuff |
2302 | | |
2303 | | if ( empty($q['author']) || ($q['author'] == '0') ) { |
2304 | | $whichauthor = ''; |
2305 | | } else { |
2306 | | $q['author'] = (string)urldecode($q['author']); |
2307 | | $q['author'] = addslashes_gpc($q['author']); |
2308 | | if ( strpos($q['author'], '-') !== false ) { |
2309 | | $eq = '!='; |
2310 | | $andor = 'AND'; |
2311 | | $q['author'] = explode('-', $q['author']); |
2312 | | $q['author'] = (string)absint($q['author'][1]); |
2313 | | } else { |
2314 | | $eq = '='; |
2315 | | $andor = 'OR'; |
| 2305 | |
| 2306 | if ( ! empty( $q['author'] ) && $q['author'] != '0' ) { |
| 2307 | $q['author'] = addslashes_gpc( '' . urldecode( $q['author'] ) ); |
| 2308 | $authors = array_unique( array_map( 'intval', (array) preg_split( '/[,\s]+/', $q['author'] ) ) ); |
| 2309 | foreach ( $authors as $author ) { |
| 2310 | $key = $author > 0 ? 'author__in' : 'author__not_in'; |
| 2311 | $q[$key][] = abs( $author ); |
2316 | 2312 | } |
2317 | | $author_array = preg_split('/[,\s]+/', $q['author']); |
2318 | | $_author_array = array(); |
2319 | | foreach ( $author_array as $key => $_author ) |
2320 | | $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . absint($_author); |
2321 | | $whichauthor .= ' AND (' . implode(" $andor ", $_author_array) . ')'; |
2322 | | unset($author_array, $_author_array); |
2323 | | } |
2324 | | |
| 2313 | $q['author'] = implode( ',', $authors ); |
| 2314 | } |
| 2315 | |
| 2316 | if ( ! empty( $q['author__in'] ) ) { |
| 2317 | $author__in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__in'] ) ) ); |
| 2318 | $where .= " AND {$wpdb->posts}.post_author IN ($author__in) "; |
| 2319 | } |
| 2320 | |
| 2321 | if ( ! empty( $q['author__not_in'] ) ) { |
| 2322 | $author__not_in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__not_in'] ) ) ); |
| 2323 | $where .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) "; |
| 2324 | } |
| 2325 | |
2325 | 2326 | // Author stuff for nice URLs |
2326 | 2327 | |
2327 | 2328 | if ( '' != $q['author_name'] ) { |