r32073 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32072‎ | r32073 | r32074 >
Date:19:23, 17 March 2008
Author:aaron
Status:old
Tags:
Comment:
*Fix some escaping issues
*$remaining and such were not getting used anymore, use them again.
Modified paths:
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUndelete.php
@@ -701,7 +701,8 @@
702702 $wgOut->addHTML( "<ul>\n" );
703703 while( $row = $result->fetchObject() ) {
704704 $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
705 - $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() );
 705+ $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ),
 706+ 'target=' . $title->getPrefixedUrl() );
706707 #$revs = wfMsgHtml( 'undeleterevisions', $wgLang->formatNum( $row->count ) );
707708 $revs = wfMsgExt( 'undeleterevisions',
708709 array( 'parseinline' ),
@@ -1019,7 +1020,7 @@
10201021
10211022 while( $row = $revisions->fetchObject() ) {
10221023 $remaining--;
1023 - $wgOut->addHTML( $this->formatRevisionRow( $row , $sk ) );
 1024+ $wgOut->addHTML( $this->formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) );
10241025 }
10251026 $revisions->free();
10261027 $wgOut->addHTML("</ul>");
@@ -1048,7 +1049,7 @@
10491050 return true;
10501051 }
10511052
1052 - private function formatRevisionRow( $row, $sk ) {
 1053+ private function formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) {
10531054 global $wgUser, $wgLang;
10541055
10551056 $rev = new Revision( array(
@@ -1071,9 +1072,11 @@
10721073 # Last link
10731074 if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
10741075 $last = wfMsgHtml('diff');
 1076+ } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) {
 1077+ $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'),
 1078+ "target=" . $this->mTargetObj->getPrefixedUrl() . "&timestamp=$ts&diff=prev" );
10751079 } else {
1076 - $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'),
1077 - "target=" . $this->mTarget . "&timestamp=" . $row->ar_timestamp . "&diff=prev" );
 1080+ $last = wfMsgHtml('diff');
10781081 }
10791082 } else {
10801083 $checkBox = '';
@@ -1095,10 +1098,10 @@
10961099 // If revision was hidden from sysops
10971100 $del = wfMsgHtml('rev-delundel');
10981101 } else {
 1102+ $ts = wfTimestamp( TS_MW, $row->ar_timestamp );
10991103 $del = $sk->makeKnownLinkObj( $revdel,
11001104 wfMsgHtml('rev-delundel'),
1101 - 'target=' . urlencode( $this->mTarget ) .
1102 - '&artimestamp=' . urlencode( $row->ar_timestamp ) );
 1105+ 'target=' . $this->mTargetObj->getPrefixedUrl() . "&artimestamp=$ts" );
11031106 // Bolden oversighted content
11041107 if( $rev->isDeleted( Revision::DELETED_RESTRICTED ) )
11051108 $del = "<strong>$del</strong>";
@@ -1143,8 +1146,8 @@
11441147 } else {
11451148 $del = $sk->makeKnownLinkObj( $revdel,
11461149 wfMsgHtml('rev-delundel'),
1147 - 'target=' . urlencode( $this->mTarget ) .
1148 - '&fileid=' . urlencode( $row->fa_id ) );
 1150+ 'target=' . $this->mTargetObj->getPrefixedUrl() .
 1151+ '&fileid=' . $row->fa_id );
11491152 // Bolden oversighted content
11501153 if( $file->isDeleted( File::DELETED_RESTRICTED ) )
11511154 $del = "<strong>$del</strong>";
@@ -1176,7 +1179,8 @@
11771180 if( !$rev->userCan(Revision::DELETED_TEXT) ) {
11781181 return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
11791182 } else {
1180 - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), "target={$this->mTarget}&timestamp=$ts" );
 1183+ $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
 1184+ "target=".$this->mTargetObj->getPrefixedUrl()."&timestamp=$ts" );
11811185 if( $rev->isDeleted(Revision::DELETED_TEXT) )
11821186 $link = '<span class="history-deleted">' . $link . '</span>';
11831187 return $link;
@@ -1193,7 +1197,8 @@
11941198 if( !$file->userCan(File::DELETED_FILE) ) {
11951199 return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
11961200 } else {
1197 - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), "target={$this->mTarget}&file=$key" );
 1201+ $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
 1202+ "target=".$this->mTargetObj->getPrefixedUrl()."&file=$key" );
11981203 if( $file->isDeleted(File::DELETED_FILE) )
11991204 $link = '<span class="history-deleted">' . $link . '</span>';
12001205 return $link;

Status & tagging log