(!$wgTitle->isProtected() || $wgUser->isSysop()) ) {
$t = wfMsg( 'editthispage' );
$oid = $red = '';
- if ( !empty($redirect) ) {
+ if ( !empty($redirect) && $redirect == 'no' ) {
$red = "&redirect={$redirect}";
}
if ( !empty($oldid) && ! isset( $diff ) ) {
- $oid = "&oldid={$oldid}";
+ $oid = "&oldid=" . IntVal( $oldid );
}
$s = $wgTitle->getFullURL( "action=edit{$oid}{$red}" );
$s = 'document.location = "' .$s .'";';
}
if ( $wgTitle->userCanEdit() ) {
- $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.$oldid : false;
+ $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.IntVal( $oldid ) : false;
$istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
$istalkclass = $istalk?' istalk':'';
$content_actions['edit'] = array(
);
}
} else {
- $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.$oldid : '';
+ $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.IntVal( $oldid ) : '';
$content_actions['viewsource'] = array('class' => ($action == 'edit') ? 'selected' : false,
'text' => wfMsg('viewsource'),
'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid));