1.4.6 - zp_page_check


Theme changes
It is now manditory that themes support the url page out-of-bounds checks if they deviate from the standard index/album/image, etc. pagination schema. This is done by implementing a page validity check function and storing it's name in the variable $_zp_page_check. See any of the standard themes for example implementations. If your theme does not implement this and deviates from the norm, you will get 404 errors from what should be valid page links.

Can the developers explain this a little more, i am trying to understand the new purpose of this to determine if my theme needs a custom function to check page validity. Looking at the different implementations in the core themes and the new function in template_functions.php, still having problems processing. Maybe if I knew why this was implemented, or what it is supposed to prevent? Is it a security issue?

Thanks!

Comments

  • Prior to 1.4.5 support releases if an URL was entered with a page number and the page number was "out of range" Zenphoto would still produce a page rather than a 404 error.

    There was a ticket on this with a full discussion, but I could not find it quickly. The basic issue is that only the theme "knows" in all cases if a page number in the URL is valid. For instance, with the Garland theme, page numbers on the index.php page are not valid if Zenpage is enabled but are if albums are shown on that page.

    There is basic handling for "standard" gallery type themes, so it is only special cases that need be handled. Probably the best approach is to look at the functions used by the Effervescence+, Garland, and Zenpage themes to see what they look for.
  • acrylian Administrator, Developer
  • gjr Member
    Excellent - thank you both, I get it now.
Sign In or Register to comment.