X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..a6f44f0edcda2471c5a33e4156c1c9488c7f3210:/wp-includes/comment-template.php diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 5bacda18..afbee05f 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -393,8 +393,8 @@ function comment_date( $d = '', $comment_ID = 0 ) { /** * Retrieve the excerpt of the current comment. * - * Will cut each word and only output the first 20 words with '...' at the end. - * If the word count is less than 20, then no truncating is done and no '...' + * Will cut each word and only output the first 20 words with '…' at the end. + * If the word count is less than 20, then no truncating is done and no '…' * will appear. * * @since 1.5.0 @@ -419,7 +419,7 @@ function get_comment_excerpt( $comment_ID = 0 ) { for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } - $excerpt .= ($use_dotdotdot) ? '...' : ''; + $excerpt .= ($use_dotdotdot) ? '…' : ''; return apply_filters('get_comment_excerpt', $excerpt); } @@ -516,7 +516,7 @@ function get_comment_link( $comment = null, $args = array() ) { * @return string The link to the comments */ function get_comments_link($post_id = 0) { - return get_permalink($post_id) . '#comments'; + return apply_filters( 'get_comments_link', get_permalink( $post_id ) . '#comments', $post_id ); } /** @@ -532,7 +532,7 @@ function comments_link( $deprecated = '', $deprecated_2 = '' ) { _deprecated_argument( __FUNCTION__, '0.72' ); if ( !empty( $deprecated_2 ) ) _deprecated_argument( __FUNCTION__, '1.3' ); - echo get_comments_link(); + echo esc_url( get_comments_link() ); } /** @@ -810,11 +810,8 @@ function pings_open( $post_id = null ) { * @uses $post Gets the ID of the current post for the token */ function wp_comment_form_unfiltered_html_nonce() { - global $post; - - $post_id = 0; - if ( !empty($post) ) - $post_id = $post->ID; + $post = get_post(); + $post_id = $post ? $post->ID : 0; if ( current_user_can( 'unfiltered_html' ) ) { wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false ); @@ -897,7 +894,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false update_comment_cache($wp_query->comments); if ( $separate_comments ) { - $wp_query->comments_by_type = &separate_comments($comments); + $wp_query->comments_by_type = separate_comments($comments); $comments_by_type = &$wp_query->comments_by_type; } @@ -907,7 +904,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false $overridden_cpage = true; } - if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE) + if ( !defined('COMMENTS_TEMPLATE') ) define('COMMENTS_TEMPLATE', true); $include = apply_filters('comments_template', STYLESHEETPATH . $file ); @@ -1247,11 +1244,11 @@ class Walker_Comment extends Walker { case 'div': break; case 'ol': - echo "
' . ( $req ? '*' : '' ) . - '
', - 'url' => '' . - '
', + 'email' => '' . + '
', + 'url' => '' . + '
', ); $required_text = sprintf( ' ' . __('Required fields are marked %s'), '*' ); $defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', $fields ), - 'comment_field' => '', + 'comment_field' => '', 'must_log_in' => '
' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
', - 'logged_in_as' => '' . sprintf( __( 'Logged in as %2$s. Log out?' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
', + 'logged_in_as' => '' . sprintf( __( 'Logged in as %2$s. Log out?' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
', 'comment_notes_before' => '' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '
', 'comment_notes_after' => ' ', 'id_form' => 'commentform', @@ -1546,6 +1636,7 @@ function comment_form( $args = array(), $post_id = null ) { 'title_reply_to' => __( 'Leave a Reply to %s' ), 'cancel_reply_link' => __( 'Cancel reply' ), 'label_submit' => __( 'Post Comment' ), + 'format' => 'xhtml', ); $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) ); @@ -1553,13 +1644,13 @@ function comment_form( $args = array(), $post_id = null ) { ?> -