[BUGFIX] Paginate Widget: Correctly highlight current page
With #28283 the current page is correctly highlighted most of the
time. But if a non-existing page is requested (for example by
manually setting the currentPage-argument to a number higher than
the number of total pages) the last page should be highlighted, but
That is fixed with this change by making sure that ``numberOfPages``
is always an integer.
Releases: master, 2.2, 2.1