really small, and somewhat inconsistent with each other.
* (bug 30466) Entries in iwlinks table are now cleared when moving a page over
redirect
+* (bug 31674) Can't edit watchlist if it contains special pages
=== API changes in 1.18 ===
* BREAKING CHANGE: action=watch now requires POST and token.
MediaWiki.org, and is covered under the GNU Free Documentation License (except
for pages that explicitly state that their contents are in the public domain):
- http://www.mediawiki.org/wiki/Documentation
+ http://www.mediawiki.org/wiki/Documentation
== Mailing list ==
A mailing list is available for MediaWiki user support and discussion:
- http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
+ http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
A low-traffic announcements-only list is also available:
- http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce
+ http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce
It's highly recommended that you sign up for one of these lists if you're
going to run a public MediaWiki, so you can be notified of security fixes.
$this->invalidateCache();
}
+ /**
+ * Cleans up watchlist by removing invalid entries from it
+ */
+ public function cleanupWatchlist() {
+ $dbw = wfGetDB( DB_MASTER );
+ $dbw->delete( 'watchlist', array( 'wl_namespace < 0', 'wl_user' => $this->getId() ), __METHOD__ );
+ }
+
/**
* Clear the user's notification timestamp for the given title.
* If e-notif e-mails are on, they will receive notification mails on
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
- if ( !$title ) {
+ if ( !$title || $titile->getNamespace() < 0 ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
}
$fields = array();
+ $haveInvalidNamespaces = false;
foreach( $this->getWatchlistInfo() as $namespace => $pages ){
-
+ if ( $namespace < 0 ) {
+ $haveInvalidNamespaces = true;
+ continue;
+ }
+
$namespace == NS_MAIN
? wfMsgHtml( 'blanknamespace' )
: htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) );
$fields['TitlesNs'.$namespace]['options'][$text] = $title->getEscapedText();
}
}
+ if ( $haveInvalidNamespaces ) {
+ wfDebug( "User {$this->getContext()->getUser()->getId()} has invalid watchlist entries, clening up...\n" );
+ $this->getContext()->getUser()->cleanupWatchlist();
+ }
$form = new EditWatchlistNormalHTMLForm( $fields, $this->getContext() );
$form->setTitle( $this->getTitle() );