WordPress.org

Make WordPress Core

Ticket #4360: 4360.diff

File 4360.diff, 12.5 KB (added by rob1n, 8 years ago)
  • wp-comments-post.php

     
    4848 
    4949$comment_type = ''; 
    5050 
    51 if ( get_option('require_name_email') && !$user->ID ) { 
    52         if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 
    53                 wp_die( __('Error: please fill the required fields (name, email).') ); 
    54         elseif ( !is_email($comment_author_email)) 
    55                 wp_die( __('Error: please enter a valid email address.') ); 
     51if ( !$user->ID ) { 
     52        if ( get_option( 'require_commenter_name' ) && $comment_author == '' ) { 
     53                wp_die( __( 'Error: please complete the name field.' ) ); 
     54        } 
     55         
     56        if ( get_option( 'require_commenter_email' ) && strlen( $comment_author_email ) < 6 ) { 
     57                wp_die( __( 'Error: please complete the email field.' ) ); 
     58        } elseif ( !is_email( $comment_author_email ) ) { 
     59                wp_die( __( 'Error: please enter a valid email address.' ) ); 
     60        } 
     61         
     62        if ( get_option( 'require_commenter_url' ) && ( $comment_author_url == '' || $comment_author_url == 'http://' ) ) { 
     63                wp_die( __( 'Error: please complete the URL field.' ); 
     64        } 
    5665} 
    5766 
    5867if ( '' == $comment_content ) 
  • wp-includes/version.php

     
    33// This holds the version number in a separate file so we can bump it without cluttering the SVN 
    44 
    55$wp_version = '2.3-alpha'; 
    6 $wp_db_version = 5539; 
     6$wp_db_version = 5542; 
    77 
    88?> 
  • wp-admin/includes/upgrade.php

     
    188188        if ( $wp_current_db_version < 4351 ) 
    189189                upgrade_old_slugs(); 
    190190         
    191         if ( $wp_current_db_version < 5539 ) 
     191        if ( $wp_current_db_version < 5542 ) 
    192192                upgrade_230(); 
    193193 
    194194         
     
    662662 
    663663                $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link_id', '$tt_id')"); 
    664664        } 
     665         
     666        if ( get_option( 'require_name_email' ) == '1' ) { 
     667                add_option( 'require_commenter_name', true ); 
     668                add_option( 'require_commenter_email', true ); 
     669                 
     670                delete_option( 'require_name_email' ); 
     671        } 
    665672} 
    666673 
    667674function upgrade_old_slugs() { 
  • wp-admin/options-discussion.php

     
    66 
    77include('admin-header.php'); 
    88?> 
    9  
    109<div class="wrap">  
    11 <h2><?php _e('Discussion Options') ?></h2>  
    12 <form method="post" action="options.php">  
    13 <?php wp_nonce_field('update-options') ?> 
    14 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p> 
    15 <fieldset class="options"> 
    16 <legend><?php echo __('Usual settings for an article:').'<br /><small><em>('.__('These settings may be overridden for individual articles.').')</em></small>'; ?></legend>  
    17 <ul>  
    18 <li>  
    19 <label for="default_pingback_flag">  
    20 <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />  
    21 <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>  
    22 </li>  
    23 <li>  
    24 <label for="default_ping_status">  
    25 <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> />  
    26 <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>  
    27 </li>  
    28 <li>  
    29 <label for="default_comment_status">  
    30 <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />  
    31 <?php _e('Allow people to post comments on the article') ?></label>  
    32 </li>  
    33 </ul>  
    34 </fieldset> 
    35 <fieldset class="options"> 
    36 <legend><?php _e('E-mail me whenever:') ?></legend>  
    37 <ul>  
    38 <li>  
    39 <label for="comments_notify">  
    40 <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />  
    41 <?php _e('Anyone posts a comment') ?> </label>  
    42 </li>  
    43 <li>  
    44 <label for="moderation_notify">  
    45 <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />  
    46 <?php _e('A comment is held for moderation') ?> </label>  
    47 </li>  
    48 </ul>  
    49 </fieldset> 
    50 <fieldset class="options"> 
    51 <legend><?php _e('Before a comment appears:') ?></legend>  
    52 <ul> 
    53 <li> 
    54 <label for="comment_moderation">  
    55 <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />  
    56 <?php _e('An administrator must always approve the comment') ?> </label>  
    57 </li>  
    58 <li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li>  
    59 <li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li>  
    60 </ul>  
    61 </fieldset> 
    62 <fieldset class="options"> 
    63 <legend><?php _e('Comment Moderation') ?></legend> 
    64 <p><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></p> 
     10        <h2><?php _e('Discussion Options') ?></h2>  
     11        <form method="post" action="options.php">  
     12                <?php wp_nonce_field('update-options') ?> 
     13                <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p> 
     14                <fieldset class="options"> 
     15                        <legend><?php echo __('Usual settings for an article:').'<br /><small><em>('.__('These settings may be overridden for individual articles.').')</em></small>'; ?></legend>  
     16                        <ul>  
     17                                <li>  
     18                                        <label for="default_pingback_flag">  
     19                                                <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />  
     20                                        <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>  
     21                                </li>  
     22                                <li>  
     23                                        <label for="default_ping_status">  
     24                                                <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> />  
     25                                        <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>  
     26                                </li>  
     27                                <li>  
     28                                        <label for="default_comment_status">  
     29                                                <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />  
     30                                        <?php _e('Allow people to post comments on the article') ?></label>  
     31                                </li>  
     32                        </ul>  
     33                </fieldset> 
     34                <fieldset class="options"> 
     35                        <legend><?php _e('E-mail me whenever:') ?></legend>  
     36                        <ul>  
     37                                <li>  
     38                                        <label for="comments_notify">  
     39                                                <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />  
     40                                        <?php _e('Anyone posts a comment') ?> </label>  
     41                                </li>  
     42                                <li>  
     43                                        <label for="moderation_notify">  
     44                                                <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />  
     45                                        <?php _e('A comment is held for moderation') ?> </label>  
     46                                </li>  
     47                        </ul>  
     48                </fieldset> 
     49                <fieldset class="options"> 
     50                        <legend><?php _e('Before a comment appears:') ?></legend>  
     51                        <ul> 
     52                                <li> 
     53                                        <label for="comment_moderation">  
     54                                                <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />  
     55                                        <?php _e('An administrator must always approve the comment') ?> </label>  
     56                                </li> 
     57                                <li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> 
     58                                <li><label for="require_commenter_name"><input type="checkbox" name="require_commenter_name" id="require_commenter_name" <?php checked( true, (bool) get_option( 'require_commenter_name' ) ); ?>/> <?php _e( 'Require commenter&#8217;s name' ); ?></label></li> 
     59                                <li><label for="require_commenter_email"><input type="checkbox" name="require_commenter_email" id="require_commenter_email" <?php checked( true, (bool) get_option( 'require_commenter_email' ) ); ?>/> <?php _e( 'Require commenter&#8217;s email' ); ?></label></li> 
     60                                <li><label for="require_commenter_url"><input type="checkbox" name="require_commenter_url" id="require_commenter_url" <?php checked( true, (bool) get_option( 'require_commenter_url' ) ); ?>/><?php _e( 'Require commenter&#8217;s URL' ); ?></label></li> 
     61                        </ul>  
     62                </fieldset> 
     63                <fieldset class="options"> 
     64                        <legend><?php _e('Comment Moderation') ?></legend> 
     65                        <p><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></p> 
    6566 
    66 <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="moderation.php">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p> 
    67 <p>  
    68 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>  
    69 </p>  
    70 </fieldset> 
    71 <fieldset class="options"> 
    72 <legend><?php _e('Comment Blacklist') ?></legend> 
    73 <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p> 
    74 <p>  
    75 <textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>  
    76 </p> 
    77 </fieldset> 
    78 <p class="submit"> 
    79 <input type="hidden" name="action" value="update" />  
    80 <input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys" />  
    81 <input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />  
    82 </p> 
    83 </form> 
     67                        <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="moderation.php">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p> 
     68                        <p>  
     69                                <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>  
     70                        </p>  
     71                </fieldset> 
     72                <fieldset class="options"> 
     73                        <legend><?php _e('Comment Blacklist') ?></legend> 
     74                        <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p> 
     75                        <p>  
     76                                <textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>  
     77                        </p> 
     78                </fieldset> 
     79                <p class="submit"> 
     80                        <input type="hidden" name="action" value="update" />  
     81                        <input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys" />  
     82                        <input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />  
     83                </p> 
     84        </form> 
    8485</div> 
    8586 
    8687<?php include('./admin-footer.php'); ?> 
     88 No newline at end of file