diff --git a/includes/ChangesList.php b/includes/ChangesList.php
index 45fef5ff39b..7e9807b2b90 100644
--- a/includes/ChangesList.php
+++ b/includes/ChangesList.php
@@ -92,20 +92,9 @@ class ChangesList {
$r .= $rcObj->usertalklink ;
# Comment
- if ( ($rc_comment != '' || $rc_type == RC_EDIT_COMMENT) &&
- $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
-
- $rc_comment = $this->skin->formatComment($rc_comment, $rcObj->getTitle());
-
- # If a summary comment change, we want to form the message "was ($rc_moved_to_title)
- # now ($rc_comment)".
- if ( $rc_type == RC_EDIT_COMMENT ) {
- $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' );
- $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rcObj->getTitle() );
- $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' );
- $r .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment );
- } else
- $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' );
+ if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
+ $rc_comment=$this->skin->formatComment($rc_comment, $rcObj->getTitle());
+ $r .= $wgContLang->emphasize( ' ('.$rc_comment.')' );
}
$r .= "
\n" ;
@@ -335,20 +324,6 @@ class ChangesList {
$msg = ( $rc_type == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
$s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } else if ( $rc_type == RC_EDIT_COMMENT ) {
- # Diff
- $s .= '(' . wfMsg( 'diff' ) . ') (';
- # History link
- $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
- $s .= ') . . ';
-
- # M and ! (minor and unpatrolled)
- if ( $rc_minor ) { $s .= ''.$message["minoreditletter"].' '; }
- if ( !$rc_patrolled ) { $s .= '! '; }
-
- # Put a link to the revision the comment is for, in a message.
- $s .= wfMsg( "eccommentchanged" ,
- $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) );
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
# Log updates, etc
$logtype = $matches[1];
@@ -433,20 +408,9 @@ class ChangesList {
if($userTalkLink) $s.=' ('.$userTalkLink.')';
# Add comment
- if ( (('' != $rc_comment && '*' != $rc_comment) || $rc_type == RC_EDIT_COMMENT) &&
- $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
-
- $rc_comment = $this->skin->formatComment( $rc_comment, $rc->getTitle() );
-
- # If a summary comment change, we want to form the message "was ($rc_moved_to_title)
- # now ($rc_comment)".
- if ( $rc_type == RC_EDIT_COMMENT ) {
- $rc_comment = $wgContLang->emphasize( '(' . $rc_comment . ')' );
- $rc_moved_to_title = $this->skin->formatComment( $rc_moved_to_title, $rc->getTitle() );
- $rc_moved_to_title = $wgContLang->emphasize( '(' . $rc_moved_to_title . ')' );
- $s .= ' ' . wfMsg( 'ecrccommentformat', $rc_moved_to_title, $rc_comment );
- } else
- $s .= $wgContLang->emphasize(' (' . $rc_comment . ')');
+ if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
+ $rc_comment = $this->skin->formatComment($rc_comment,$rc->getTitle());
+ $s .= $wgContLang->emphasize(' (' . $rc_comment . ')');
}
$s .= "\n";
@@ -497,10 +461,6 @@ class ChangesList {
$msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
$clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } else if ( $rc_type == RC_EDIT_COMMENT ) {
- # Put a link to the revision the comment is for, in a message.
- $clink = wfMsg( "eccommentchanged" ,
- $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no&oldid=' . $rc_this_oldid ) );
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
# Log updates, etc
$logtype = $matches[1];
@@ -525,9 +485,7 @@ class ChangesList {
} else {
$rcIdQuery = '';
}
- if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG ||
- $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ||
- $rc_type == RC_EDIT_COMMENT) {
+ if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$curLink = $message['cur'];
$diffLink = $message['diff'];
} else {
@@ -585,7 +543,7 @@ class ChangesList {
# Page moves go on their own line
$title = $rc->getTitle();
$secureName = $title->getPrefixedDBkey();
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT || $rc_type == RC_EDIT_COMMENT ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Use an @ character to prevent collision with page names
$this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
} else {
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 27623039bc7..690671bc83a 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -685,19 +685,6 @@ $wgCapitalLinks = true;
# can be imported, these should be 'trusted'.
$wgImportSources = array();
-# Set to true to allow editing comments (revision summaries) via
-# clicking on editcomment_icon.gif. This will appear in History
-# and Contributions listings for just revisions made by the
-# logged in user. SysOps may edit all revisions.
-$wgAllowEditComments = false;
-
-# If $wgAllowEditComments, the maximum age in minutes of a
-# revision a user may revise the comment of, -1 = forever,
-# 0 = never. Sysops may always edit a comment.
-# Note: The user is given an extra 2 minutes once they start
-# editing a comment.
-$wgUserEditCommentTimeout = 0;
-
# Set this to the number of authors that you want to be credited below an
# article text. Set it to zero to hide the attribution block, and a
# negative number (like -1) to show all authors. Note that this will
diff --git a/includes/Defines.php b/includes/Defines.php
index c7bfd9b5aaf..ab7507a247b 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -80,10 +80,4 @@ $wgAvailableRights = array('read', 'edit', 'move', 'delete', 'undelete',
'protect', 'block', 'userrights', 'createaccount', 'upload', 'asksql',
'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot');
-/**#@+
- * Edit Comments really needs its own separate rights.
- * Two separate rights are required; edit all comments, edit your own comment.
- */
-define('EDIT_COMMENT_ALL', 'protect');
-
?>
diff --git a/includes/EditComment.php b/includes/EditComment.php
deleted file mode 100644
index 6edb39d8b13..00000000000
--- a/includes/EditComment.php
+++ /dev/null
@@ -1,321 +0,0 @@
-mArticle =& $article;
- $this->mTitle =& $article->mTitle;
- $this->origAction = $action;
- $this->commentValue = "";
-
- # Come up with an earliest time that a user may edit an article.
- $this->expiry = $this->fudgedExpiry = '00000000000000'; # assume that any positive date is OK
- if (! $wgUser->isAllowed(EDIT_COMMENT_ALL) && $wgUserEditCommentTimeout >= 0) {
-
- $this->expiry = wfTimestampPlus( wfTimestampNow(), -$wgUserEditCommentTimeout * 60 );
-
- # If the user is allowed to change a time at all, add a little extra "fudge"
- # time to give the user the time to edit the change and save it.
- $fudgeTime = ($wgUserEditCommentTimeout) ? ($wgUserEditCommentTimeout + 2) :
- $wgUserEditCommentTimeout;
- $this->fudgedExpiry = wfTimestampPlus( wfTimestampNow(), -$fudgeTime * 60);
- }
- }
-
- function process() {
- global $wgRequest;
- global $wgUser, $wgOut, $wgScript;
- global $wgAllowEditComments;
-
- # Pick up parameters that may be part of the URL.
- $this->revisionID = $wgRequest->getInt( 'oldid' );
- $this->returnTo = $wgRequest->getVal( 'returnto' );
- $this->returnToAction = $wgRequest->getVal( 'returntoaction' );
- $this->returnToTarget = $wgRequest->getVal( 'returntotarget' );
-
- # See if this is a submit.
- $doSave = $wgRequest->getVal( 'wpSave' );
- $doCancel = $wgRequest->getVal( 'wpCancel' );
-
- # We're either setting up the form for the first time, or picking existing form data.
- if (! $doSave && ! $doCancel) {
-
- $this->getRevisionComment();
-
- # Error out if the user is not allowed to edit this comment.
- if ( ! $wgAllowEditComments || ! $wgUser->getID() ||
- ( ! $wgUser->isAllowed(EDIT_COMMENT_ALL) && $wgUser->getID() != $this->revisionUID )) {
-
- $wgOut->errorpage( "eceditsummary", "eccantdo" );
- return;
- }
-
- # Error out if the time the user had to edit this comment has expired.
- if ( $this->revisionTimeStamp < $this->expiry) {
- $wgOut->errorpage( "eceditsummary", "ecctimeexpired" );
- return;
- }
-
- $this->showForm( "" );
- }
- else {
- $this->revisionTimeStamp = $wgRequest->getText( 'wpTimestamp' );
- $this->revisionMinor = ( $wgRequest->getVal( 'wpMinorCheck' ) == "checked" ) ? 1 : 0;
- }
-
- # Save the new comment, if requested.
- if ($doSave) {
- $this->commentValue = $wgRequest->getText( 'wpComment' );
-
- # Error out if the time the user had to edit this comment has expired.
- if ( $this->revisionTimeStamp < $this->fudgedExpiry) {
-
- # Put the error message in the form to allow the user to copy their work.
- $this->showForm( wfMsg( "ecctimeexpired" ) );
- return;
- }
-
- # Note if something went wrong.
- $doWrong = ! $this->saveComment();
- }
-
- # If Cancel, restore the original values.
- if ($doCancel)
- $this->getRevisionComment();
-
-
- # Let the user know an operation completed.
- if ($doSave || $doCancel) {
- $sfmsg = "";
- if ($doSave) {
- if ($doWrong)
- $sfmsg = wfMsg( "ecsavewrong" );
- else
- $sfmsg = wfMsg( "ecsaveok" );
- }
- if ($doCancel) # (shouldn't have both these messages.)
- $sfmsg .= wfMsg( "eccanceled" );
-
- $this->showForm( $sfmsg );
- }
- }
-
- # Show the Edit Comment (Summary) form. If $rsltMsg == "" the form is being
- # displayed for the first time, with buttons. Otherwise it is being shown
- # to provide confirmation and exit the process. Present a 'returnTo' link
- # in that case.
- function showForm( $rsltMsg )
- {
- global $wgOut, $wgUser, $wgLang;
- global $wgRequest;
-
- $rt = $ra = $rtt = $buttonRow = '';
-
- $wgOut->setArticleFlag( false );
-
- # The title is the article whose comments are being edited,
- # the subtitle "Editing summary of " revision.
- $wgOut->setPagetitle( $this->mTitle->getPrefixedText() );
- if ($this->revisionID == 0)
- $wgOut->setSubtitle( wfMsg( "ecsubtitlerev0" ) );
- else {
- $wgOut->setSubtitle( wfMsg( "ecsubtitle",
- $wgLang->timeanddate( $this->revisionTimeStamp, true ) ) );
- }
- $wgOut->addHTML( "
" . htmlspecialchars( wfMsg( "ecwarnings" ) ) . "
" ); - # $wgOut->addWikiText( htmlspecialchars( wfMsg( "ecwarnings" ) ) ); - - $editcommentlabel = htmlspecialchars( wfMsg( "eccommentlabel" ) ); - $editsubmit = htmlspecialchars( wfMsg( "ecsubmitbutton" ) ); - $editcancel = htmlspecialchars( wfMsg( "eccancelbutton" ) ); - $htmlcomment = htmlspecialchars( $this->commentValue ); - # $titleObj = Title::makeTitle( NS_SPECIAL, "Blockip" ); - # $action = $titleObj->escapeLocalURL( "action=editcomment" ); - - if ($this->returnTo) - $rt = "&returnto=" . $this->returnTo; - if ($this->returnToAction) - $ra = "&returntoaction=" . $this->returnToAction; - if ($this->returnToTarget) - $rtt = "&returntotarget=" . $this->returnToTarget; - $action = $this->mTitle->escapeLocalURL( "action=editcomment&oldid=" . $this->revisionID . $rt . $ra . $rtt); - - # Either show the result message, or the Submit & Cancel buttons. - if ( "" != $rsltMsg ) { - # $wgOut->setSubtitle( htmlspecialchars( wfMsg( "formerror" ) ) ); - $wgOut->addHTML( "{$rsltMsg}
\n" ); - } - else { - $buttonRow = " -' . wfMsg( $msg ) . "
\n" ); + $this->addHTML( '' . wfMsg( $msg ) . "
\n" ); $this->returnToMain( false ); $this->output(); @@ -676,9 +676,8 @@ class OutputPage { * return from error messages or notes * @param $auto automatically redirect the user after 10 seconds * @param $returnto page title to return to. Default is Main Page. - * @param $query extra parameters to be added to the $returnto URL. */ - function returnToMain( $auto = true, $returnto = NULL, $query = NULL ) { + function returnToMain( $auto = true, $returnto = NULL ) { global $wgUser, $wgOut, $wgRequest; if ( $returnto == NULL ) { @@ -690,12 +689,12 @@ class OutputPage { if ( '' == $returnto ) { $returnto = wfMsgForContent( 'mainpage' ); } - $link = $sk->makeKnownLink( $returnto, '', $query ); + $link = $sk->makeKnownLink( $returnto, '' ); $r = wfMsg( 'returnto', $link ); if ( $auto ) { $titleObj = Title::newFromText( $returnto ); - $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL( $query ) ); + $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL() ); } $wgOut->addHTML( "\n$r
\n" ); } diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 1da58f752d0..f229792d3c8 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -144,8 +144,7 @@ class PageHistory { } function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor, $counter = '' ) { - global $wgLang, $wgContLang, $wgUser; - global $wgStylePath, $wgAllowEditComments, $wgUserEditCommentTimeout; + global $wgLang, $wgContLang; static $message; if( !isset( $message ) ) { @@ -200,27 +199,6 @@ class PageHistory { $arbitrary .= ''; } $s .= "({$curlink}) (!OLDID!{$oid}!) $arbitrary {$link} {$ul}"; - - # Show an edit user comments icon if conditions are met. - # Option must be on, user logged in, user edited comment or a sysop, - # and the article must be recent enough. - if ( $wgAllowEditComments && $wgUser->getID() && - ($u == $wgUser->getID() || $wgUser->isAllowed(EDIT_COMMENT_ALL)) && - ($wgUser->isAllowed(EDIT_COMMENT_ALL) || $wgUserEditCommentTimeout < 0 || - $ts >= wfTimestampPlus( wfTimestampNow(), -$wgUserEditCommentTimeout * 60)) ) { - - $tooltip = wfMsg( "ectooltip" ); - $rt = $this->mTitle->getPrefixedURL(); - $rt = $this->mSkin->makeKnownLinkObj( $this->mTitle, "