getgrav/grav-plugin-pagination

Error 404 due to removal of protocol slash

Closed this issue · 0 comments

In pagination.html.twig it reads:

{% set url =  (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
…
{% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
…
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}

These lines cause 404 errors because they also remove a protocol slash (“https:/” instead of “https://”). If changed to the following it works like a charm:

{% set url =  (base_url ~ pagination.params ~ pagination.prevUrl|replace({'//':'/'})) %}
…
{% set url = (base_url ~ pagination.params ~ paginate.url|replace({'//':'/'})) %}
…
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl|replace({'//':'/'}))

Cannot tell if these changes trigger side effects, have not observed so far.