Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -77,18 +77,18 @@ |
78 | 78 | if(!$a_title) continue; |
79 | 79 | if( $a_title->getPrefixedText() == $wgTitle->getPrefixedText() ) break; |
80 | 80 | } |
81 | | - if( ($i>0) && ($i+1<count($links[1])) ){ |
| 81 | + if( ($i>0) && ($i<count($links[1])) ){ |
82 | 82 | $prev_title = Title::newFromText( $links[1][$i-1] ); |
83 | 83 | if(!$prev_title) return $err; |
84 | 84 | $prev_url = $prev_title->getFullURL(); |
| 85 | + } |
| 86 | + else $prev_url = ''; |
| 87 | + if( ($i>=0) && ($i+1<count($links[1])) ){ |
85 | 88 | $next_title = Title::newFromText( $links[1][$i+1] ); |
86 | 89 | if(!$next_title) return $err; |
87 | 90 | $next_url = $next_title->getFullURL(); |
88 | 91 | } |
89 | | - else { |
90 | | - $prev_url = ''; |
91 | | - $next_url = ''; |
92 | | - } |
| 92 | + else $next_url = ''; |
93 | 93 | |
94 | 94 | return array( $index_url, $prev_url, $next_url ); |
95 | 95 | |