Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (20 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r4299 r4495  
    1919                        if (empty($word)) { continue; }
    2020
    21                         // Do some escaping magic so that '#' chars in the 
     21                        // Do some escaping magic so that '#' chars in the
    2222                        // spam words don't break things:
    2323                        $word = preg_quote($word, '#');
    2424
    25                         $pattern = "#$word#i"; 
     25                        $pattern = "#$word#i";
    2626                        if ( preg_match($pattern, $author) ) return false;
    2727                        if ( preg_match($pattern, $email) ) return false;
    … …  
    104104                $query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'";
    105105                if (false == $include_unapproved) {
    106                     $query .= " AND comment_approved = '1'";
    107                 }
    108                 $myrow = $wpdb->get_row($query, ARRAY_A);
     106                                $query .= " AND comment_approved = '1'";
     107                }
     108                                $myrow = $wpdb->get_row($query, ARRAY_A);
    109109        } else {
    110110                $myrow['comment_ID'] = $postc->comment_ID;
    … …  
    158158                $comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]);
    159159                $comment_author_email = stripslashes($comment_author_email);
    160                 $comment_author_email = wp_specialchars($comment_author_email, true);   
     160                $comment_author_email = wp_specialchars($comment_author_email, true);
    161161                $_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
    162162        }
    … …  
    244244                if ( empty($word) ) { continue; }
    245245
    246                 // Do some escaping magic so that '#' chars in the 
     246                // Do some escaping magic so that '#' chars in the
    247247                // spam words don't break things:
    248248                $word = preg_quote($word, '#');
    249249
    250                 $pattern = "#$word#i"; 
     250                $pattern = "#$word#i";
    251251                if ( preg_match($pattern, $author    ) ) return true;
    252252                if ( preg_match($pattern, $email     ) ) return true;
    … …  
    329329                $user_id = 0;
    330330
    331         $result = $wpdb->query("INSERT INTO $wpdb->comments 
     331        $result = $wpdb->query("INSERT INTO $wpdb->comments
    332332        (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id)
    333         VALUES 
     333        VALUES
    334334        ('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')
    335335        ");
    … …  
    398398
    399399function wp_set_comment_status($comment_id, $comment_status) {
    400     global $wpdb;
    401 
    402     switch($comment_status) {
     400                global $wpdb;
     401
     402                switch($comment_status) {
    403403                case 'hold':
    404404                        $query = "UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID='$comment_id' LIMIT 1";
    … …  
    407407                        $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
    408408                break;
    409                 case 'spam':
    410                         $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
    411                 break;
     409                case 'spam':
     410                        $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
     411                break;
    412412                case 'delete':
    413413                        return wp_delete_comment($comment_id);
    … …  
    415415                default:
    416416                        return false;
    417     }
    418    
    419     if ($wpdb->query($query)) {
     417                }
     418
     419                if ($wpdb->query($query)) {
    420420                do_action('wp_set_comment_status', $comment_id, $comment_status);
    421421
    … …  
    426426                        $wpdb->query( "UPDATE $wpdb->posts SET comment_count = '$c->c' WHERE ID = '$comment_post_ID'" );
    427427                return true;
    428     } else {
     428                } else {
    429429                return false;
    430     }
     430                }
    431431}
    432432
    … …  
    583583                pingback($ping->post_content, $ping->ID);
    584584        }
    585        
     585
    586586        // Do Enclosures
    587587        while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
    … …  
    706706
    707707                if ($pingback_server_url) {
    708                         @ set_time_limit( 60 ); 
     708                        @ set_time_limit( 60 );
    709709                         // Now, the RPC call
    710710                        debug_fwrite($log, "Page Linked To: $pagelinkedto \n");
Note: See TracChangeset for help on using the changeset viewer.