Changeset 20636
- Timestamp:
- 04/28/2012 09:25:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20635 r20636 491 491 } 492 492 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 493 511 /** 494 512 * Prepares taxonomy data for return in an XML-RPC object. … … 767 785 */ 768 786 function wp_newPost( $args ) { 787 if ( ! $this->minimum_args( $args, 4 ) ) 788 return $this->error; 789 769 790 $this->escape( $args ); 770 791 … … 1039 1060 */ 1040 1061 function wp_editPost( $args ) { 1062 if ( ! $this->minimum_args( $args, 5 ) ) 1063 return $this->error; 1064 1041 1065 $this->escape( $args ); 1042 1066 … … 1091 1115 */ 1092 1116 function wp_deletePost( $args ) { 1117 if ( ! $this->minimum_args( $args, 4 ) ) 1118 return $this->error; 1119 1093 1120 $this->escape( $args ); 1094 1121 … … 1164 1191 */ 1165 1192 function wp_getPost( $args ) { 1193 if ( ! $this->minimum_args( $args, 4 ) ) 1194 return $this->error; 1195 1166 1196 $this->escape( $args ); 1167 1197 … … 1218 1248 */ 1219 1249 function wp_getPosts( $args ) { 1250 if ( ! $this->minimum_args( $args, 3 ) ) 1251 return $this->error; 1252 1220 1253 $this->escape( $args ); 1221 1254 … … 1304 1337 */ 1305 1338 function wp_newTerm( $args ) { 1339 if ( ! $this->minimum_args( $args, 4 ) ) 1340 return $this->error; 1341 1306 1342 $this->escape( $args ); 1307 1343 … … 1388 1424 */ 1389 1425 function wp_editTerm( $args ) { 1426 if ( ! $this->minimum_args( $args, 5 ) ) 1427 return $this->error; 1428 1390 1429 $this->escape( $args ); 1391 1430 … … 1477 1516 */ 1478 1517 function wp_deleteTerm( $args ) { 1518 if ( ! $this->minimum_args( $args, 5 ) ) 1519 return $this->error; 1520 1479 1521 $this->escape( $args ); 1480 1522 … … 1541 1583 */ 1542 1584 function wp_getTerm( $args ) { 1585 if ( ! $this->minimum_args( $args, 5 ) ) 1586 return $this->error; 1587 1543 1588 $this->escape( $args ); 1544 1589 … … 1591 1636 */ 1592 1637 function wp_getTerms( $args ) { 1638 if ( ! $this->minimum_args( $args, 4 ) ) 1639 return $this->error; 1640 1593 1641 $this->escape( $args ); 1594 1642 … … 1663 1711 */ 1664 1712 function wp_getTaxonomy( $args ) { 1713 if ( ! $this->minimum_args( $args, 4 ) ) 1714 return $this->error; 1715 1665 1716 $this->escape( $args ); 1666 1717 … … 1704 1755 */ 1705 1756 function wp_getTaxonomies( $args ) { 1757 if ( ! $this->minimum_args( $args, 3 ) ) 1758 return $this->error; 1759 1706 1760 $this->escape( $args ); 1707 1761 … … 3010 3064 */ 3011 3065 function wp_getPostType( $args ) { 3066 if ( ! $this->minimum_args( $args, 4 ) ) 3067 return $this->error; 3068 3012 3069 $this->escape( $args ); 3013 3070 … … 3053 3110 */ 3054 3111 function wp_getPostTypes( $args ) { 3112 if ( ! $this->minimum_args( $args, 3 ) ) 3113 return $this->error; 3114 3055 3115 $this->escape( $args ); 3056 3116
Note: See TracChangeset
for help on using the changeset viewer.