Skip to:
Content

bbPress.org

Changeset 6228


Ignore:
Timestamp:
01/12/2017 11:28:11 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Pagination: Use preg_replace to find & remove page=1 query arguments.

Fixes #2702. Props thebrandonallen, tharsheblows.

Location:
trunk/src/includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/template.php

    r6199 r6228  
    275275                $bbp->reply_query->pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $bbp->reply_query->pagination_links );
    276276            } else {
    277                 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links );
     277                $bbp->reply_query->pagination_links = preg_replace( '/&paged=1(?=[^0-9])/m', '', $bbp->reply_query->pagination_links );
    278278            }
    279279        }
  • trunk/src/includes/search/template.php

    r5951 r6228  
    156156            $bbp->search_query->pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $bbp->search_query->pagination_links );
    157157        } else {
    158             $bbp->search_query->pagination_links = str_replace( '&paged=1', '', $bbp->search_query->pagination_links );
     158            $bbp->search_query->pagination_links = preg_replace( '/&paged=1(?=[^0-9])/m', '', $bbp->search_query->pagination_links );
    159159        }
    160160    }
  • trunk/src/includes/topics/template.php

    r6226 r6228  
    911911                $pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $pagination_links );
    912912            } else {
    913                 $pagination_links = str_replace( '&paged=1', '', $pagination_links );
     913                $pagination_links = preg_replace( '/&paged=1(?=[^0-9])/m', '', $pagination_links );
    914914            }
    915915
Note: See TracChangeset for help on using the changeset viewer.