Merge "Convert article delete to use OOUI"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 365736f..65131ec 100644 (file)
@@ -81,6 +81,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                if ( ( $config->get( 'EnotifWatchlist' ) || $config->get( 'ShowUpdatedMarker' ) )
                        && $request->getVal( 'reset' )
                        && $request->wasPosted()
+                       && $user->matchEditToken( $request->getVal( 'token' ) )
                ) {
                        $user->clearAllNotifications();
                        $output->redirect( $this->getPageTitle()->getFullURL( $opts->getChangedValues() ) );
@@ -110,7 +111,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         */
        protected function transformFilterDefinition( array $filterDefinition ) {
                if ( isset( $filterDefinition['showHideSuffix'] ) ) {
-                         $filterDefinition['showHide'] = 'wl' . $filterDefinition['showHideSuffix'];
+                       $filterDefinition['showHide'] = 'wl' . $filterDefinition['showHideSuffix'];
                }
 
                return $filterDefinition;
@@ -245,8 +246,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
-               &$join_conds, FormOptions $opts ) {
-
+               &$join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                parent::buildQuery( $tables, $fields, $conds, $query_options, $join_conds,
                        $opts );
@@ -262,8 +263,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function doMainQuery( $tables, $fields, $conds, $query_options,
-               $join_conds, FormOptions $opts ) {
-
+               $join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                $user = $this->getUser();
 
@@ -660,6 +661,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                                'id' => 'mw-watchlist-resetbutton' ] ) . "\n" .
                        Xml::submitButton( $this->msg( 'enotif_reset' )->text(),
                                [ 'name' => 'mw-watchlist-reset-submit' ] ) . "\n" .
+                       Html::hidden( 'token', $user->getEditToken() ) . "\n" .
                        Html::hidden( 'reset', 'all' ) . "\n";
                        foreach ( $nondefaults as $key => $value ) {
                                $form .= Html::hidden( $key, $value ) . "\n";