Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | $change = RecentChange::newFromConds( |
178 | 178 | array( |
179 | 179 | // Add redundant user,timestamp condition so we can use the existing index |
180 | | - 'rc_user_text' => $this->mNewRev->getRawUserText(), |
| 180 | + 'rc_user_text' => $this->mNewRev->getUserText(false), |
181 | 181 | 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), |
182 | 182 | 'rc_this_oldid' => $this->mNewid, |
183 | 183 | 'rc_last_oldid' => $this->mOldid, |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1113,7 +1113,7 @@ |
1114 | 1114 | if( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) { |
1115 | 1115 | $link = wfMsgHtml( 'rev-deleted-user' ); |
1116 | 1116 | } else if( $rev->userCan( Revision::DELETED_USER ) ) { |
1117 | | - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ); |
| 1117 | + $link = $this->userLink( $rev->getUser(false), $rev->getUserText(false) ); |
1118 | 1118 | } else { |
1119 | 1119 | $link = wfMsgHtml( 'rev-deleted-user' ); |
1120 | 1120 | } |
— | — | @@ -1133,8 +1133,8 @@ |
1134 | 1134 | if( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) { |
1135 | 1135 | $link = wfMsgHtml( 'rev-deleted-user' ); |
1136 | 1136 | } else if( $rev->userCan( Revision::DELETED_USER ) ) { |
1137 | | - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ) . |
1138 | | - ' ' . $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() ); |
| 1137 | + $link = $this->userLink( $rev->getUser(false), $rev->getUserText(false) ) . |
| 1138 | + ' ' . $this->userToolLinks( $rev->getUser(false), $rev->getUserText(false) ); |
1139 | 1139 | } else { |
1140 | 1140 | $link = wfMsgHtml( 'rev-deleted-user' ); |
1141 | 1141 | } |
— | — | @@ -1340,7 +1340,7 @@ |
1341 | 1341 | if( $rev->isDeleted( Revision::DELETED_COMMENT ) && $isPublic ) { |
1342 | 1342 | $block = " <span class=\"comment\">" . wfMsgHtml( 'rev-deleted-comment' ) . "</span>"; |
1343 | 1343 | } else if( $rev->userCan( Revision::DELETED_COMMENT ) ) { |
1344 | | - $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle(), $local ); |
| 1344 | + $block = $this->commentBlock( $rev->getComment(false), $rev->getTitle(), $local ); |
1345 | 1345 | } else { |
1346 | 1346 | $block = " <span class=\"comment\">" . wfMsgHtml( 'rev-deleted-comment' ) . "</span>"; |
1347 | 1347 | } |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | $this->dieUsage("There is no revision ID $oldid", 'missingrev'); |
65 | 65 | if(!$rev->userCan(Revision::DELETED_TEXT)) |
66 | 66 | $this->dieUsage("You don't have permission to view deleted revisions", 'permissiondenied'); |
67 | | - $text = $rev->getRawText(); |
| 67 | + $text = $rev->getText(false); |
68 | 68 | $titleObj = $rev->getTitle(); |
69 | 69 | $p_result = $wgParser->parse($text, $titleObj, $popts); |
70 | 70 | } |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -430,9 +430,11 @@ |
431 | 431 | * Fetch revision's user id if it's available to all users |
432 | 432 | * @return int |
433 | 433 | */ |
434 | | - public function getUser() { |
435 | | - if( $this->isDeleted( self::DELETED_USER ) ) { |
| 434 | + public function getUser( $isPublic = true ) { |
| 435 | + if( $isPublic && $this->isDeleted( self::DELETED_USER ) ) { |
436 | 436 | return 0; |
| 437 | + } else if( !$this->userCan( self::DELETED_USER ) ) { |
| 438 | + return 0; |
437 | 439 | } else { |
438 | 440 | return $this->mUser; |
439 | 441 | } |
— | — | @@ -450,9 +452,11 @@ |
451 | 453 | * Fetch revision's username if it's available to all users |
452 | 454 | * @return string |
453 | 455 | */ |
454 | | - public function getUserText() { |
455 | | - if( $this->isDeleted( self::DELETED_USER ) ) { |
| 456 | + public function getUserText( $isPublic = true ) { |
| 457 | + if( $isPublic && $this->isDeleted( self::DELETED_USER ) ) { |
456 | 458 | return ""; |
| 459 | + } else if( !$this->userCan( self::DELETED_USER ) ) { |
| 460 | + return ""; |
457 | 461 | } else { |
458 | 462 | return $this->mUserText; |
459 | 463 | } |
— | — | @@ -470,9 +474,11 @@ |
471 | 475 | * Fetch revision comment if it's available to all users |
472 | 476 | * @return string |
473 | 477 | */ |
474 | | - function getComment() { |
475 | | - if( $this->isDeleted( self::DELETED_COMMENT ) ) { |
| 478 | + function getComment( $isPublic = true ) { |
| 479 | + if( $isPublic && $this->isDeleted( self::DELETED_COMMENT ) ) { |
476 | 480 | return ""; |
| 481 | + } else if( !$this->userCan( self::DELETED_COMMENT ) ) { |
| 482 | + return ""; |
477 | 483 | } else { |
478 | 484 | return $this->mComment; |
479 | 485 | } |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -1223,8 +1223,8 @@ |
1224 | 1224 | if( !$file->userCan(File::DELETED_USER) ) { |
1225 | 1225 | return '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>'; |
1226 | 1226 | } else { |
1227 | | - $link = $sk->userLink( $file->getRawUser(), $file->getRawUserText() ) . |
1228 | | - $sk->userToolLinks( $file->getRawUser(), $file->getRawUserText() ); |
| 1227 | + $link = $sk->userLink( $file->getUser(false), $file->getUserText(false) ) . |
| 1228 | + $sk->userToolLinks( $file->getUser(false), $file->getUserText(false) ); |
1229 | 1229 | if( $file->isDeleted(File::DELETED_USER) ) |
1230 | 1230 | $link = '<span class="history-deleted">' . $link . '</span>'; |
1231 | 1231 | return $link; |