bug fixes
[lhc/web/wiklou.git] / includes / SpecialWatchlist.php
index 3dd8806..619dc38 100644 (file)
@@ -1,6 +1,6 @@
 <?php
-include_once( "SpecialRecentchanges.php" );
-include_once( "WatchedItem.php" );
+require_once( "SpecialRecentchanges.php" );
+require_once( "WatchedItem.php" );
 
 function wfSpecialWatchlist()
 {
@@ -93,7 +93,7 @@ function wfSpecialWatchlist()
                        "<p>" . wfMsg( "watcheditlist" ) . "</p>\n" );
                
                $wgOut->addHTML( "<form action='" .
-                       $specialTitle->getURL( "action=submit", true ) .
+                       $specialTitle->escapeLocalUrl( "action=submit" ) .
                        "' method='post'>\n" .
                        "<ul>\n" );
                $sql = "SELECT wl_namespace,wl_title FROM watchlist WHERE wl_user=$uid";
@@ -103,13 +103,13 @@ function wfSpecialWatchlist()
                while( $s = wfFetchObject( $res ) ) {
                        $t = Title::makeTitle( $s->wl_namespace, $s->wl_title );
                        $t = $t->getPrefixedText();
-                       $wgOut->addHTML( "<li><input type='checkbox' name='id[]' value=\"" . htmlspecialchars($t) . "\">" .
+                       $wgOut->addHTML( "<li><input type='checkbox' name='id[]' value=\"" . htmlspecialchars($t) . "\" />" .
                                $sk->makeKnownLink( $t, $t ) .
                                "</li>\n" );
                }
                $wgOut->addHTML( "</ul>\n" .
                        "<input type='submit' name='remove' value='" .
-                       wfMsg( "removechecked" ) . "'>\n" .
+                       wfMsg( "removechecked" ) . "' />\n" .
                        "</form>\n" );
                
                return;
@@ -135,7 +135,7 @@ function wfSpecialWatchlist()
        
        $wgOut->addHTML( "<i>" . wfMsg( "watchdetails",
                $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), $y,
-               $specialTitle->getURL( "magic=yes", true ) ) . "</i><br>\n" );
+               $specialTitle->escapeLocalUrl( "magic=yes" ) ) . "</i><br />\n" );
         
 
        $sql = "SELECT
@@ -157,7 +157,7 @@ function wfSpecialWatchlist()
                $note = wfMsg( "wlnote", $wgLang->formatNum( $limit ), $wgLang->formatNum( round($days*24) ) );
        else
                $note = "";
-       $wgOut->addHTML( "\n<hr>\n{$note}\n<br>" );
+       $wgOut->addHTML( "\n<hr />\n{$note}\n<br />" );
        $note = wlCutoffLinks( $days, $limit );
        $wgOut->addHTML( "{$note}\n" );
 
@@ -168,10 +168,11 @@ function wfSpecialWatchlist()
 
        $sk = $wgUser->getSkin();
        $s = $sk->beginRecentChangesList();
-
+       $counter = 1;
        while ( $obj = wfFetchObject( $res ) ) {
                # Make fake RC entry
                $rc = RecentChange::newFromCurRow( $obj );
+               $rc->counter = $counter++;
                $s .= $sk->recentChangesLine( $rc, true );
        }
        $s .= $sk->endRecentChangesList();