Changeset - 373c6afba371
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-29 19:06:30
ohnobinki@ohnopublishing.net
Don't give an irrelavent 404 when there are 0 nonconflicting permutations.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -199,13 +199,18 @@ class Schedule
 
    define('SP_PERMUTATIONS_PER_PAGE', 256);
 

	
 
    $npages = ceil($this->nPermutations / SP_PERMUTATIONS_PER_PAGE);
 
    $page = 0;
 
    if (isset($_REQUEST['page']))
 
      $page = $_REQUEST['page'];
 
    if ($page >= $npages)
 
    /*
 
     * only display the ``this page doesn't exist'' 404 if there is at
 
     * least one permutation. Otherwise, we give an irrelevant 404 for
 
     * users with no permutations.
 
     */
 
    if ($this->nPermutations && $page >= $npages)
 
      Page::show_404('Unable to find page ' . $page . ', there are only ' . $this->nPermutations . ' non-conflicting permutations, for a total of ' . $npages . ' pages.');
 
    /* zero-based */
 
    $first_permutation = $page * SP_PERMUTATIONS_PER_PAGE;
 
    $last_permutation = min($this->nPermutations, $first_permutation + SP_PERMUTATIONS_PER_PAGE);
 

	
 
    $footcloser = '';
0 comments (0 inline, 0 general)