Make WordPress Core


Ignore:
Timestamp:
05/02/2012 09:13:08 PM (13 years ago)
Author:
nacin
Message:

We indent with spaces, not tabs. props sivel. fixes #20394.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r20696 r20703  
    491491    }
    492492
    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     }
     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    }
    510510
    511511    /**
     
    786786     */
    787787    function wp_newPost( $args ) {
    788         if ( ! $this->minimum_args( $args, 4 ) )
    789             return $this->error;
     788        if ( ! $this->minimum_args( $args, 4 ) )
     789            return $this->error;
    790790
    791791        $this->escape( $args );
     
    10631063     */
    10641064    function wp_editPost( $args ) {
    1065         if ( ! $this->minimum_args( $args, 5 ) )
    1066             return $this->error;
     1065        if ( ! $this->minimum_args( $args, 5 ) )
     1066            return $this->error;
    10671067
    10681068        $this->escape( $args );
     
    11181118     */
    11191119    function wp_deletePost( $args ) {
    1120         if ( ! $this->minimum_args( $args, 4 ) )
    1121             return $this->error;
     1120        if ( ! $this->minimum_args( $args, 4 ) )
     1121            return $this->error;
    11221122
    11231123        $this->escape( $args );
     
    11941194     */
    11951195    function wp_getPost( $args ) {
    1196         if ( ! $this->minimum_args( $args, 4 ) )
    1197             return $this->error;
     1196        if ( ! $this->minimum_args( $args, 4 ) )
     1197            return $this->error;
    11981198
    11991199        $this->escape( $args );
     
    12511251     */
    12521252    function wp_getPosts( $args ) {
    1253         if ( ! $this->minimum_args( $args, 3 ) )
    1254             return $this->error;
     1253        if ( ! $this->minimum_args( $args, 3 ) )
     1254            return $this->error;
    12551255
    12561256        $this->escape( $args );
     
    13401340     */
    13411341    function wp_newTerm( $args ) {
    1342         if ( ! $this->minimum_args( $args, 4 ) )
    1343             return $this->error;
     1342        if ( ! $this->minimum_args( $args, 4 ) )
     1343            return $this->error;
    13441344
    13451345        $this->escape( $args );
     
    14271427     */
    14281428    function wp_editTerm( $args ) {
    1429         if ( ! $this->minimum_args( $args, 5 ) )
    1430             return $this->error;
     1429        if ( ! $this->minimum_args( $args, 5 ) )
     1430            return $this->error;
    14311431
    14321432        $this->escape( $args );
     
    15191519     */
    15201520    function wp_deleteTerm( $args ) {
    1521         if ( ! $this->minimum_args( $args, 5 ) )
    1522             return $this->error;
     1521        if ( ! $this->minimum_args( $args, 5 ) )
     1522            return $this->error;
    15231523
    15241524        $this->escape( $args );
     
    15861586     */
    15871587    function wp_getTerm( $args ) {
    1588         if ( ! $this->minimum_args( $args, 5 ) )
    1589             return $this->error;
     1588        if ( ! $this->minimum_args( $args, 5 ) )
     1589            return $this->error;
    15901590
    15911591        $this->escape( $args );
     
    16391639     */
    16401640    function wp_getTerms( $args ) {
    1641         if ( ! $this->minimum_args( $args, 4 ) )
    1642             return $this->error;
     1641        if ( ! $this->minimum_args( $args, 4 ) )
     1642            return $this->error;
    16431643
    16441644        $this->escape( $args );
     
    17141714     */
    17151715    function wp_getTaxonomy( $args ) {
    1716         if ( ! $this->minimum_args( $args, 4 ) )
    1717             return $this->error;
     1716        if ( ! $this->minimum_args( $args, 4 ) )
     1717            return $this->error;
    17181718
    17191719        $this->escape( $args );
     
    17581758     */
    17591759    function wp_getTaxonomies( $args ) {
    1760         if ( ! $this->minimum_args( $args, 3 ) )
    1761             return $this->error;
     1760        if ( ! $this->minimum_args( $args, 3 ) )
     1761            return $this->error;
    17621762
    17631763        $this->escape( $args );
     
    24432443        $comments_struct = array();
    24442444
    2445     // FIXME: we already have the comments, why query them again?
     2445        // FIXME: we already have the comments, why query them again?
    24462446        for ( $i = 0; $i < $num_comments; $i++ ) {
    24472447            $comment = wp_xmlrpc_server::wp_getComment(array(
     
    30683068     */
    30693069    function wp_getPostType( $args ) {
    3070         if ( ! $this->minimum_args( $args, 4 ) )
    3071             return $this->error;
     3070        if ( ! $this->minimum_args( $args, 4 ) )
     3071            return $this->error;
    30723072
    30733073        $this->escape( $args );
     
    31143114     */
    31153115    function wp_getPostTypes( $args ) {
    3116         if ( ! $this->minimum_args( $args, 3 ) )
    3117             return $this->error;
     3116        if ( ! $this->minimum_args( $args, 3 ) )
     3117            return $this->error;
    31183118
    31193119        $this->escape( $args );
Note: See TracChangeset for help on using the changeset viewer.