* Fixed unclosed <p> tag
[lhc/web/wiklou.git] / includes / SpecialSpecialpages.php
index f14f4f3..265af2f 100644 (file)
@@ -41,8 +41,13 @@ function wfSpecialSpecialpages() {
  * @param $sk skin object ???
  */
 function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
-       global $wgLang, $wgOut;
+       global $wgLang, $wgOut, $wgSortSpecialPages;
 
+       if( count( $pages ) == 0 ) {
+               # Yeah, that was pointless. Thanks for coming.
+               return;
+       }
+       
        /** Put them into a sortable array */
        $sortedPages = array();
        foreach ( $pages as $name => $page ) {
@@ -52,7 +57,9 @@ function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
        }
        
        /** Sort */
-       ksort( $sortedPages );
+       if ( $wgSortSpecialPages ) {
+               ksort( $sortedPages );
+       }
 
        /** Now output the HTML */
        $wgOut->addHTML( '<h2>' . wfMsg( $heading ) . "</h2>\n<ul>" );