slight alteration to comment
[lhc/web/wiklou.git] / includes / SpecialMaintenance.php
index 0e3f180..7b8fc49 100644 (file)
@@ -1,4 +1,4 @@
-<?
+<?php
 
 function sns()
 {
@@ -47,7 +47,7 @@ function wfSpecialMaintenance( $par=NULL )
        $l = $l[0] ;
        $r .= $l.">\n" ;
        $r .= "<input type=submit name='submitmll' value='" ;
-       $r .= wfMsg("missinglanguagelinksbutton");
+       $r .= htmlspecialchars(wfMsg("missinglanguagelinksbutton"), ENT_QUOTES);
        $r .= "'>\n" ;
        $r .= "<select name=thelang>\n" ;
        $a = $wgLang->getLanguageNames();
@@ -95,7 +95,9 @@ function wfSpecialDisambiguations()
        list( $limit, $offset ) = wfCheckLimits();
 
        $dp = wfStrencode( wfMsg("disambiguationspage") );
-
+       
+       die( "wfSpecialDisambiguation is broken. Link tables have changed...\n" );
+       
        $sql = "SELECT la.l_from,la.l_to,"
                . " lb.l_from AS source,lb.l_to AS dest,"
                . " c.cur_id, c.cur_title AS dt"
@@ -109,13 +111,12 @@ function wfSpecialDisambiguations()
                . " AND d.cur_namespace=0"
                . " LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
-       $top = "<p>".wfMsg("disambiguationstext")."</p><br>\n";
-       $top = str_replace ( "$1" , $sk->makeKnownLink ( $dp ) , $top ) ;
-       $top = getMaintenancePageBacklink().$top ;
+       $top = "<p>".wfMsg( "disambiguationstext", $sk->makeKnownLink( $dp ) )."</p><br>\n";
+       $top = getMaintenancePageBacklink() . $top;
        $top .= wfShowingResults( $offset, $limit );
        $wgOut->addHTML( "<p>{$top}\n" );
 
@@ -143,9 +144,10 @@ function wfSpecialDoubleRedirects()
 
        list( $limit, $offset ) = wfCheckLimits();
 
+       die( "wfSpecialDoubleRedirects() is broken for now; link tables are changed." );
        $sql = "SELECT l_from,l_to,cb.cur_text AS rt,cb.cur_title AS ti FROM links,cur AS ca, cur AS cb WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id AND l_from=ca.cur_title AND ca.cur_namespace=0 LIMIT {$offset}, {$limit}" ;
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("doubleredirectstext")."</p><br>\n";
@@ -181,7 +183,7 @@ function wfSpecialBrokenRedirects()
 
        $sql = "SELECT bl_to,cur_title FROM brokenlinks,cur WHERE cur_is_redirect=1 AND cur_namespace=0 AND bl_from=cur_id LIMIT {$offset}, {$limit}" ;
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("brokenredirectstext")."</p><br>\n";
@@ -215,7 +217,7 @@ function wfSpecialSelfLinks()
 
        $sql = "SELECT cur_title FROM cur,links WHERE cur_is_redirect=0 AND cur_namespace=0 AND l_from=cur_title AND l_to=cur_id LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("selflinkstext")."</p><br>\n";
@@ -252,7 +254,7 @@ function wfSpecialMispeelings ()
 
         # Load list from database
         $sql = "SELECT cur_text FROM cur WHERE cur_title='{$mss}' AND cur_namespace=4" ;
-        $res = wfQuery( $sql, $fname );
+        $res = wfQuery( $sql, DB_READ, $fname );
         $obj = wfFetchObject ( $res ) ;
         $l = $obj->cur_text ;
         $l = explode ( "\n" , $l ) ;
@@ -270,7 +272,7 @@ function wfSpecialMispeelings ()
                         $x = preg_replace( '/^(\S+).*$/', '$1', $x );
                        #$sql = "SELECT DISTINCT cur_title FROM cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(cur_ind_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
                        $sql = "SELECT DISTINCT cur_title FROM cur,searchindex WHERE cur_id=si_page AND cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(si_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
-                        $res = wfQuery( $sql, $fname );
+                        $res = wfQuery( $sql, DB_READ, $fname );
                         while ( $obj = wfFetchObject ( $res ) ) {
                                 if ( $cnt >= $offset AND $cnt < $offset+$limit ) {
                                         if ( $y != "" ) {
@@ -289,7 +291,7 @@ function wfSpecialMispeelings ()
                         }
                 }
         $top = getMaintenancePageBacklink();
-        $top .= "<p>".str_replace("$1",$msl,wfMsg("mispeelingstext"))."</p><br>\n";
+        $top .= "<p>".wfMsg( "mispeelingstext", $msl )."</p><br>\n";
         $top .= wfShowingResults( $offset, $limit );
         $wgOut->addHTML( "<p>{$top}\n" );
 
@@ -315,11 +317,10 @@ function wfSpecialMissingLanguageLinks()
 
        $sql = "SELECT cur_title FROM cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_title NOT LIKE '%/%' AND cur_text NOT LIKE '%[[{$thelang}:%' LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
 
-       $mll = wfMsg("missinglanguagelinkstext");
-       $mll = str_replace ( "$1" , $wgLang->getLanguageName($thelang) , $mll ) ;
+       $mll = wfMsg( "missinglanguagelinkstext", $wgLang->getLanguageName($thelang) );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>$mll</p><br>";