X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FHistoryAction.php;h=a1d1c3a197d46234f1ba3a81cb3cac62d749551b;hb=ec493cc7508e4741e370cbcd10b59ba636c13113;hp=d68ae2b5a7e62a4ab0b2ee891653bccfa973222a;hpb=3c994ff08a0be045bbef3a54f3a18bc98cb7ef5f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index d68ae2b5a7..a1d1c3a197 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -154,7 +154,7 @@ class HistoryAction extends FormlessAction { * Option to show only revisions that have been (partially) hidden via RevisionDelete */ if ( $request->getBool( 'deleted' ) ) { - $conds = array( "rev_deleted != '0'" ); + $conds = array( 'rev_deleted != 0' ); } else { $conds = array(); } @@ -176,7 +176,7 @@ class HistoryAction extends FormlessAction { ) . Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" . Html::hidden( 'action', 'history' ) . "\n" . - Xml::dateMenu( $year, $month ) . ' ' . + Xml::dateMenu( ( $year == null ? date( "Y" ) : $year ), $month ) . ' ' . ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . $checkDeleted . Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" . @@ -222,7 +222,7 @@ class HistoryAction extends FormlessAction { } if ( $offset ) { - $offsets = array( "rev_timestamp $oper '$offset'" ); + $offsets = array( 'rev_timestamp $oper ' . $dbr->addQuotes( $dbr->timestamp( $offset ) ) ); } else { $offsets = array(); } @@ -231,7 +231,7 @@ class HistoryAction extends FormlessAction { return $dbr->select( 'revision', Revision::selectFields(), - array_merge( array( "rev_page=$page_id" ), $offsets ), + array_merge( array( 'rev_page' => $page_id ), $offsets ), __METHOD__, array( 'ORDER BY' => "rev_timestamp $dirs", 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit ) @@ -626,9 +626,12 @@ class HistoryPager extends ReverseChronologicalPager { # Rollback and undo links if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) { if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) { - $this->preventClickjacking(); - $tools[] = '' . - Linker::buildRollbackLink( $rev, $this->getContext() ) . ''; + // Get a rollback link without the brackets + $rollbackLink = Linker::generateRollback( $rev, $this->getContext(), array( 'verify', 'noBrackets' ) ); + if ( $rollbackLink ) { + $this->preventClickjacking(); + $tools[] = $rollbackLink; + } } if ( !$rev->isDeleted( Revision::DELETED_TEXT )