mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 09:10:06 +00:00
Query: Non-scalar and negative values for 'p' should always result in a 404.
Previously, the 'p' query var was being run through `absint()`, which caused unexpected results. Props Akeif, kouratoras. Fixes #33372. git-svn-id: https://develop.svn.wordpress.org/trunk@38288 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1602,7 +1602,13 @@ class WP_Query {
|
||||
if ( ! empty($qv['robots']) )
|
||||
$this->is_robots = true;
|
||||
|
||||
$qv['p'] = absint($qv['p']);
|
||||
if ( ! is_scalar( $qv['p'] ) || $qv['p'] < 0 ) {
|
||||
$qv['p'] = 0;
|
||||
$qv['error'] = '404';
|
||||
} else {
|
||||
$qv['p'] = intval( $qv['p'] );
|
||||
}
|
||||
|
||||
$qv['page_id'] = absint($qv['page_id']);
|
||||
$qv['year'] = absint($qv['year']);
|
||||
$qv['monthnum'] = absint($qv['monthnum']);
|
||||
|
||||
Reference in New Issue
Block a user