versions of Safari and Konqueror
* Don't die() when update.php reaches the end of the warning count
* (bug 4071) Generate passwords long enough for $wgMinimalPasswordLength
+* (bug 1915) Fix edit links when 'direction' used with 'oldid';
+ using revision ID reported via OutputPage; Skin::editUrlOptions()
+* Remove obsolete 'redirect=no' on some edit links
+* Include oldid for the second revision on edit link on diff view
=== Caveats ===
$out->addLink( array( 'rel' => 'shortcut icon', 'href' => '/favicon.ico' ) );
$this->addMetadataLinks($out);
+
+ $this->mRevisionId = $out->mRevisionId;
wfProfileOut( $fname );
}
if($wgOut->isArticle() && $wgUser->getOption('editondblclick') &&
$wgTitle->userCanEdit() ) {
$t = wfMsg( 'editthispage' );
- $oid = $red = '';
- if ( !empty($redirect) && $redirect == 'no' ) {
- $red = "&redirect={$redirect}";
- }
- if ( !empty($oldid) && ! isset( $diff ) ) {
- $oid = "&oldid=" . intval( $oldid );
- }
- $s = $wgTitle->getFullURL( "action=edit{$oid}{$red}" );
- $s = 'document.location = "' .$s .'";';
+ $s = $wgTitle->getFullURL( $this->editUrlOptions() );
+ $s = 'document.location = "' .wfEscapeJSString( $s ) .'";';
$a += array ('ondblclick' => $s);
}
function editThisPage() {
global $wgOut, $wgTitle, $wgRequest;
- $oldid = $wgRequest->getVal( 'oldid' );
- $diff = $wgRequest->getVal( 'diff' );
- $redirect = $wgRequest->getVal( 'redirect' );
-
if ( ! $wgOut->isArticleRelated() ) {
$s = wfMsg( 'protectedpage' );
} else {
} else {
$t = wfMsg( 'viewsource' );
}
- $oid = $red = '';
- if ( !is_null( $redirect ) ) { $red = "&redirect={$redirect}"; }
- if ( $oldid && ! isset( $diff ) ) {
- $oid = '&oldid='.$oldid;
- }
- $s = $this->makeKnownLinkObj( $wgTitle, $t, "action=edit{$oid}{$red}" );
+ $s = $this->makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() );
}
return $s;
}
+
+ /**
+ * Return URL options for the 'edit page' link.
+ * This may include an 'oldid' specifier, if the current page view is such.
+ *
+ * @return string
+ * @access private
+ */
+ function editUrlOptions() {
+ if( $this->mRevisionId ) {
+ return "action=edit&oldid=" . intval( $this->mRevisionId );
+ } else {
+ return "action=edit";
+ }
+ }
function deleteThisPage() {
global $wgUser, $wgOut, $wgTitle, $wgRequest;
global $wgUser, $wgRequest;
$action = $wgRequest->getText( 'action' );
$section = $wgRequest->getText( 'section' );
- $oldid = $wgRequest->getVal( 'oldid' );
- $diff = $wgRequest->getVal( 'diff' );
$content_actions = array();
if( $this->iscontent ) {
wfProfileIn( "$fname-edit" );
if ( $this->mTitle->userCanEdit() ) {
- $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.intval( $oldid ) : false;
$istalk = $this->mTitle->isTalkPage();
$istalkclass = $istalk?' istalk':'';
$content_actions['edit'] = array(
'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass,
'text' => wfMsg('edit'),
- 'href' => $this->mTitle->getLocalUrl( 'action=edit'.$oid )
+ 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
);
if ( $istalk ) {
);
}
} else {
- $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.intval( $oldid ) : '';
$content_actions['viewsource'] = array(
'class' => ($action == 'edit') ? 'selected' : false,
'text' => wfMsg('viewsource'),
- 'href' => $this->mTitle->getLocalUrl( 'action=edit'.$oid )
+ 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
);
}
wfProfileOut( "$fname-edit" );
if( $this->loggedin || $wgValidationForAnons ) { # and $action != 'submit' ) {
# Validate tab. TODO: add validation to logged-in user rights
if($wgUseValidation && ( $action == "" || $action=='view' ) ){ # && $wgUser->isAllowed('validate')){
- if ( $oldid ) $oid = intval( $oldid ) ; # Use the oldid
+ if ( $this->mRevisionId ) $oid = intval( $this->mRevisionId ) ; # Use the oldid
else
{# Trying to get the current article revision through this weird stunt
$tid = $this->mTitle->getArticleID();