Skip to:
Content

bbPress.org

Ticket #2702: 2702.3.diff

File 2702.3.diff, 1.5 KB (added by netweb, 10 years ago)
  • src/includes/replies/template.php

     
    273273                        if ( bbp_use_pretty_urls() ) {
    274274                                $bbp->reply_query->pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $bbp->reply_query->pagination_links );
    275275                        } else {
    276                                 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links );
     276                                $bbp->reply_query->pagination_links = preg_replace_callback( '/&paged=1[^0-9]/',
     277                                        function( $matches ){
     278                                                 return str_replace( '&paged=1', '', $matches[0] );
     279                                        },
     280                                $bbp->reply_query->pagination_links );
    277281                        }
    278282                }
    279283        }
  • src/includes/topics/template.php

     
    908908                        if ( bbp_use_pretty_urls() ) {
    909909                                $pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $pagination_links );
    910910                        } else {
    911                                 $pagination_links = str_replace( '&paged=1', '', $pagination_links );
     911                                $pagination_links = preg_replace_callback( '/&paged=1[^0-9]/',
     912                                        function( $matches ){
     913                                                return str_replace( '&paged=1', '', $matches[0] );
     914                                        },
     915                                $pagination_links );
    912916                        }
    913917
    914918                        // Add before and after to pagination links