diff --git src/wp-includes/comment-template.php src/wp-includes/comment-template.php
index a972963..ad6e481 100644
|
|
function get_comment_link( $comment = null, $args = array() ) { |
736 | 736 | } |
737 | 737 | } |
738 | 738 | |
739 | | if ( $cpage ) { |
| 739 | if ( $cpage && get_option( 'page_comments' ) ) { |
740 | 740 | if ( $wp_rewrite->using_permalinks() ) { |
741 | 741 | if ( $cpage ) { |
742 | 742 | $link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage; |
diff --git tests/phpunit/tests/comment/getCommentLink.php tests/phpunit/tests/comment/getCommentLink.php
index da3d96a..b74212a 100644
|
|
class Tests_Comment_GetCommentLink extends WP_UnitTestCase { |
128 | 128 | |
129 | 129 | $this->assertContains( 'cpage=3', $found ); |
130 | 130 | } |
| 131 | |
| 132 | /** |
| 133 | * @ticket 34946 |
| 134 | */ |
| 135 | public function test_should_not_contain_comment_page_1_when_pagination_is_disabled() { |
| 136 | $this->set_permalink_structure( '/%postname%/' ); |
| 137 | update_option( 'page_comments', 0 ); |
| 138 | |
| 139 | $found = get_comment_link( self::$comments[1] ); |
| 140 | |
| 141 | $this->assertNotContains( 'comment-page-1', $found ); |
| 142 | } |
131 | 143 | } |