Ticket #3039: wp_link_pages_fix.diff

File wp_link_pages_fix.diff, 0.6 kB (added by markjaquith, 2 years ago)

fix for /trunk/

  • wp-includes/post-template.php

    old new  
    7676        else 
    7777                $file = $pagenow; //$_SERVER['PHP_SELF']; 
    7878 
     79        if ( $page > count($pages) ) // if the requested page doesn't exist 
     80                $page = count($pages); // give them the highest numbered page that DOES exist 
     81 
    7982        $content = $pages[$page-1]; 
    8083        if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) { 
    8184                $content = explode($matches[0], $content, 2);