Changeset 20703 for trunk/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 05/02/2012 09:13:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20696 r20703 491 491 } 492 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 493 /** 494 * Checks if the method received at least the minimum number of arguments. 495 * 496 * @since 3.4 497 * 498 * @param string|array $args Sanitize single string or array of strings. 499 * @param int $count Minimum number of arguments. 500 * @return boolean if $args contains at least $count arguments. 501 */ 502 protected function minimum_args( $args, $count ) { 503 if ( count( $args ) < $count ) { 504 $this->error = new IXR_Error( 400, __( 'Insufficient arguments passed to this XML-RPC method.' ) ); 505 return false; 506 } 507 508 return true; 509 } 510 510 511 511 /** … … 786 786 */ 787 787 function wp_newPost( $args ) { 788 789 788 if ( ! $this->minimum_args( $args, 4 ) ) 789 return $this->error; 790 790 791 791 $this->escape( $args ); … … 1063 1063 */ 1064 1064 function wp_editPost( $args ) { 1065 1066 1065 if ( ! $this->minimum_args( $args, 5 ) ) 1066 return $this->error; 1067 1067 1068 1068 $this->escape( $args ); … … 1118 1118 */ 1119 1119 function wp_deletePost( $args ) { 1120 1121 1120 if ( ! $this->minimum_args( $args, 4 ) ) 1121 return $this->error; 1122 1122 1123 1123 $this->escape( $args ); … … 1194 1194 */ 1195 1195 function wp_getPost( $args ) { 1196 1197 1196 if ( ! $this->minimum_args( $args, 4 ) ) 1197 return $this->error; 1198 1198 1199 1199 $this->escape( $args ); … … 1251 1251 */ 1252 1252 function wp_getPosts( $args ) { 1253 1254 1253 if ( ! $this->minimum_args( $args, 3 ) ) 1254 return $this->error; 1255 1255 1256 1256 $this->escape( $args ); … … 1340 1340 */ 1341 1341 function wp_newTerm( $args ) { 1342 1343 1342 if ( ! $this->minimum_args( $args, 4 ) ) 1343 return $this->error; 1344 1344 1345 1345 $this->escape( $args ); … … 1427 1427 */ 1428 1428 function wp_editTerm( $args ) { 1429 1430 1429 if ( ! $this->minimum_args( $args, 5 ) ) 1430 return $this->error; 1431 1431 1432 1432 $this->escape( $args ); … … 1519 1519 */ 1520 1520 function wp_deleteTerm( $args ) { 1521 1522 1521 if ( ! $this->minimum_args( $args, 5 ) ) 1522 return $this->error; 1523 1523 1524 1524 $this->escape( $args ); … … 1586 1586 */ 1587 1587 function wp_getTerm( $args ) { 1588 1589 1588 if ( ! $this->minimum_args( $args, 5 ) ) 1589 return $this->error; 1590 1590 1591 1591 $this->escape( $args ); … … 1639 1639 */ 1640 1640 function wp_getTerms( $args ) { 1641 1642 1641 if ( ! $this->minimum_args( $args, 4 ) ) 1642 return $this->error; 1643 1643 1644 1644 $this->escape( $args ); … … 1714 1714 */ 1715 1715 function wp_getTaxonomy( $args ) { 1716 1717 1716 if ( ! $this->minimum_args( $args, 4 ) ) 1717 return $this->error; 1718 1718 1719 1719 $this->escape( $args ); … … 1758 1758 */ 1759 1759 function wp_getTaxonomies( $args ) { 1760 1761 1760 if ( ! $this->minimum_args( $args, 3 ) ) 1761 return $this->error; 1762 1762 1763 1763 $this->escape( $args ); … … 2443 2443 $comments_struct = array(); 2444 2444 2445 2445 // FIXME: we already have the comments, why query them again? 2446 2446 for ( $i = 0; $i < $num_comments; $i++ ) { 2447 2447 $comment = wp_xmlrpc_server::wp_getComment(array( … … 3068 3068 */ 3069 3069 function wp_getPostType( $args ) { 3070 3071 3070 if ( ! $this->minimum_args( $args, 4 ) ) 3071 return $this->error; 3072 3072 3073 3073 $this->escape( $args ); … … 3114 3114 */ 3115 3115 function wp_getPostTypes( $args ) { 3116 3117 3116 if ( ! $this->minimum_args( $args, 3 ) ) 3117 return $this->error; 3118 3118 3119 3119 $this->escape( $args );
Note: See TracChangeset
for help on using the changeset viewer.