Ticket #36718: 36718.patch
File 36718.patch, 1.5 KB (added by , 9 years ago) |
---|
-
src/wp-includes/query.php
1593 1593 $qv['monthnum'] = absint($qv['monthnum']); 1594 1594 $qv['day'] = absint($qv['day']); 1595 1595 $qv['w'] = absint($qv['w']); 1596 $qv['m'] = preg_replace( '|[^0-9]|', '', $qv['m'] );1596 $qv['m'] = is_scalar( $qv['m'] ) ? preg_replace( '|[^0-9]|', '', $qv['m'] ) : ''; 1597 1597 $qv['paged'] = absint($qv['paged']); 1598 1598 $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers 1599 1599 $qv['author'] = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers -
tests/phpunit/tests/query/date.php
258 258 $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) ); 259 259 } 260 260 261 /** 262 * @ticket 263 */ 264 265 public function test_simple_m_with_array_expecting_results() { 266 $expected = $this->_get_query_result( ); 267 $posts = $this->_get_query_result( array( 268 'm' => array( '1234' ), // ignored 269 ) ); 270 271 $this->assertEquals( $expected, $posts ); 272 } 273 261 274 public function test_simple_monthnum_expecting_results() { 262 275 $posts = $this->_get_query_result( array( 263 276 'monthnum' => 5,