diff --git a/wp-includes/query.php b/wp-includes/query.php index ea6ec2aafd..ee7a8c703d 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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']); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3ef1c2d903..01ce236ca2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38286'; +$wp_version = '4.7-alpha-38288'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.