Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/10/2014 03:54:41 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Bracketize extensions, and missed a spot in the admin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/akismet.php

    r5321 r5441  
    6464
    6565                // Add the checks
    66                 foreach ( $checks as $type => $functions )
    67                         foreach ( $functions as $function => $priority )
     66                foreach ( $checks as $type => $functions ) {
     67                        foreach ( $functions as $function => $priority ) {
    6868                                add_filter( $function, array( $this, $type . '_post'  ), $priority );
     69                        }
     70                }
    6971
    7072                // Update post meta
     
    103105
    104106                // Post is not published
    105                 if ( bbp_get_public_status_id() !== $post_data['post_status'] )
     107                if ( bbp_get_public_status_id() !== $post_data['post_status'] ) {
    106108                        return $post_data;
     109                }
    107110
    108111                // Cast the post_author to 0 if it's empty
    109                 if ( empty( $post_data['post_author'] ) )
     112                if ( empty( $post_data['post_author'] ) ) {
    110113                        $post_data['post_author'] = 0;
     114                }
    111115
    112116                /** Author ************************************************************/
     
    138142
    139143                // Use post parent for permalink
    140                 if ( !empty( $post_data['post_parent'] ) )
     144                if ( !empty( $post_data['post_parent'] ) ) {
    141145                        $post_permalink = get_permalink( $post_data['post_parent'] );
     146                }
    142147
    143148                // Put post_data back into usable array
     
    256261
    257262                // Bail if get_post() fails
    258                 if ( empty( $_post ) )
     263                if ( empty( $_post ) ) {
    259264                        return;
     265                }
    260266
    261267                // Bail if we're spamming, but the post_status isn't spam
    262                 if ( ( 'spam' === $request_type ) && ( bbp_get_spam_status_id() !== $_post->post_status ) )
     268                if ( ( 'spam' === $request_type ) && ( bbp_get_spam_status_id() !== $_post->post_status ) ) {
    263269                        return;
     270                }
    264271
    265272                // Set some default post_data
     
    282289                // Use the original version stored in post_meta if available
    283290                $as_submitted = get_post_meta( $post_id, '_bbp_akismet_as_submitted', true );
    284                 if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )
     291                if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) ) {
    285292                        $post_data = array_merge( $post_data, $as_submitted );
     293                }
    286294
    287295                // Add the reporter IP address
     
    289297
    290298                // Add some reporter info
    291                 if ( is_object( $current_user ) )
     299                if ( is_object( $current_user ) ) {
    292300                    $post_data['reporter'] = $current_user->user_login;
     301                }
    293302
    294303                // Add the current site domain
    295                 if ( is_object( $current_site ) )
     304                if ( is_object( $current_site ) ) {
    296305                        $post_data['site_domain'] = $current_site->domain;
     306                }
    297307
    298308                // Place your slide beneath the microscope
     
    434444
    435445                // Ensure we have a post object
    436                 if ( empty( $_post ) )
     446                if ( empty( $_post ) ) {
    437447                        $_post = get_post( $post_id );
     448                }
    438449
    439450                // Set up Akismet last post data
    440                 if ( !empty( $this->last_post ) )
     451                if ( !empty( $this->last_post ) ) {
    441452                        $as_submitted = $this->last_post['bbp_post_as_submitted'];
     453                }
    442454
    443455                // wp_insert_post() might be called in other contexts. Ensure this is
     
    587599
    588600                // Save the terms for later in case the reply gets hammed
    589                 if ( !empty( $terms ) )
     601                if ( !empty( $terms ) ) {
    590602                        update_post_meta( $reply_id, '_bbp_akismet_spam_terms', $terms );
     603                }
    591604
    592605                // Keep the topic tags the same for now
     
    626639
    627640                // Use specific IP (if provided)
    628                 if ( !empty( $ip ) && long2ip( ip2long( $ip ) ) )
     641                if ( !empty( $ip ) && long2ip( ip2long( $ip ) ) ) {
    629642                        $http_host = $ip;
     643                }
    630644
    631645                // WP HTTP class is available
     
    651665
    652666                        // Bail if the response is an error
    653                         if ( is_wp_error( $response ) )
     667                        if ( is_wp_error( $response ) ) {
    654668                                return '';
     669                        }
    655670
    656671                        // No errors so return response
Note: See TracChangeset for help on using the changeset viewer.