$actiontext = wfMsgHtml('rev-deleted-event');
} else {
$actiontext = LogPage::actionText( $row->rc_log_type, $row->rc_log_action,
- $titleObj, $wgUser->getSkin(), LogPage::extractParams($row->rc_params,true,true) );
+ $titleObj, RequestContext::getMain()->getSkin(), LogPage::extractParams($row->rc_params,true,true) );
}
}
return self::formatDiffRow( $titleObj,
global $wgFeedDiffCutoff, $wgLang, $wgUser;
wfProfileIn( __METHOD__ );
- $skin = $wgUser->getSkin();
# log enties
$completeText = '<p>' . implode( ' ',
array_filter(
array(
$actiontext,
- $skin->formatComment( $comment ) ) ) ) . "</p>\n";
+ Linker::formatComment( $comment ) ) ) ) . "</p>\n";
//NOTE: Check permissions for anonymous users, not current user.
// No "privileged" version should end up in the cache.
$anon = new User();
$accErrors = $title->getUserPermissionsErrors( 'read', $anon, true );
- # Early exist when the page is not an article, on errors and no newid to
- # compare.
+ // Can't diff special pages, unreadable pages or pages with no new revision
+ // to compare against: just return the text.
if( $title->getNamespace() < 0 || $accErrors || !$newid ) {
wfProfileOut( __METHOD__ );
return $completeText;
if ( $wgFeedDiffCutoff <= 0 || ( strlen( $diffText ) > $wgFeedDiffCutoff ) ) {
// Omit large diffs
- $diffText = self::getDiffText( $title, $newid, $oldid);
+ $diffText = self::getDiffLink( $title, $newid, $oldid );
} elseif ( $diffText === false ) {
// Error in diff engine, probably a missing revision
$diffText = "<p>Can't load revision $newid</p>";
}
if ( $wgFeedDiffCutoff <= 0 || strlen( $newtext ) > $wgFeedDiffCutoff ) {
// Omit large new page diffs, bug 29110
- $diffText = self::getDiffText( $title, $newid );
+ $diffText = self::getDiffLink( $title, $newid );
} else {
$diffText = '<p><b>' . wfMsg( 'newpage' ) . '</b></p>' .
'<div>' . nl2br( htmlspecialchars( $newtext ) ) . '</div>';
* @param $newid Integer newid for this diff
* @param $oldid Integer|null oldid for the diff. Null means it is a new article
*/
- protected static function getDiffText( Title $title, $newid, $oldid = null ) {
+ protected static function getDiffLink( Title $title, $newid, $oldid = null ) {
$queryParameters = ($oldid == null)
? "diff={$newid}"
: "diff={$newid}&oldid={$oldid}" ;
- $diffLink = $title->escapeFullUrl( $queryParameters );
+ $diffUrl = $title->getFullUrl( $queryParameters );
- $diffText = Html::RawElement( 'a', array( 'href' => $diffLink ),
- htmlspecialchars( wfMsgForContent( 'showdiff' ) )
- );
+ $diffLink = Html::element( 'a', array( 'href' => $diffUrl ),
+ wfMsgForContent( 'showdiff' ) );
- return $diffText;
+ return $diffLink;
}
/**