Make WordPress Core

Changeset 2556


Ignore:
Timestamp:
04/20/2005 03:37:23 AM (19 years ago)
Author:
matt
Message:

Line ending fixes and commenting cleanups from Scott Reilly

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r2552 r2556  
    3333
    3434if ( get_settings('require_name_email') && !$user_ID ) {
    35     if ('' == $comment_author_email || '' == $comment_author)
     35    if ( 7 > strlen($comment_author_email) || '' == $comment_author )
    3636        die( __('Error: please fill the required fields (name, email).') );
    3737    elseif ( !is_email($comment_author_email))
  • trunk/wp-includes/functions-post.php

    r2523 r2556  
    481481    $now_gmt = current_time('mysql', 1);
    482482
     483    if ( $user_id ) {
     484        $userdata = get_userdata($user_id);
     485        $post_author = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = '$comment_post_ID' LIMIT 1");
     486    }
     487
    483488    // Simple flood-protection
    484489    if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$user_ip' OR comment_author_email = '$email' ORDER BY comment_date DESC LIMIT 1") ) {
     
    497502    if ( wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) )
    498503        $approved = 'spam';
    499    
     504    if ( $userdata && ( $user_id == $post_author || $userdata['user_level'] >= 9 ) )
     505        $approved = 1;
     506
    500507    $approved = apply_filters('pre_comment_approved', $approved);
    501508
  • trunk/wp-includes/pluggable-functions.php

    • Property svn:eol-style set to native
  • trunk/wp-trackback.php

    r2555 r2556  
    2828$request_array = 'HTTP_POST_VARS';
    2929
    30 if ( empty($_GET['tb_id']) ) {
     30if ( !$_GET['tb_id'] ) {
    3131    $tb_id = explode('/', $_SERVER['REQUEST_URI']);
    32     $tb_id = intval($tb_id[count($tb_id)-1]);
    33 } else {
    34     $tb_id = intval($_GET['tb_id']);
     32    $tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
    3533}
    3634
     
    5553    $tb_id = $posts[0]->ID;
    5654
    57 if ( !$tb_id )
     55if ( !intval( $tb_id ) )
    5856    trackback_response(1, 'I really need an ID for this to work.');
    5957
     
    6967    $pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $tb_id");
    7068
    71     if ('open' != $pingstatus)
     69    if ( 'open' != $pingstatus )
    7270        trackback_response(1, 'Sorry, trackbacks are closed for this item.');
    7371
Note: See TracChangeset for help on using the changeset viewer.