Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search pagination link incorrect for "fid" parameter after first page #95

Open
hbcafe opened this issue Jun 9, 2015 · 0 comments
Open

Comments

@hbcafe
Copy link

hbcafe commented Jun 9, 2015

To reproduce, search for a term against a specific forum or forums. The search URL will include the fid%5B%5 D= parameter for the first page, but the encoded [] will be stripped off subsequent pages.

Below is a workaround, not a correction. Modify phpbbseo/usu/pagination:

public function generate_page_link($base_url, $on_page, $start_name, $per_page)
{
    // ADD: Workaround problem with "fid" getting mangled.
    if (strpos($base_url, 'search.php') !== false) {
        $base_url = str_replace('fid%5B%5D=', 'fid[]=', $base_url);
    }

This prevents the subsequent code for mangling the fid parameter. Restore it prior to returning:

    // we'll see if start_name has use cases, and we can still work with rewriterules
    $s = ($on_page > 1) ? sprintf($paginated[$base_url], $start_name, ($on_page - 1) * $per_page) : $base_url;

    // ADD: Workaround problem with "fid" getting mangled. 
    if (strpos($base_url, 'search.php') !== false) {
        $s = str_replace('fid[]=', 'fid%5B%5D=', $s);
    }
    return $s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant