* The 'BeforeWatchlist' hook has been removed due to internal changes in
Special:Watchlist. 'SpecialWatchlistQuery' should now be used by extensions
to customize the watchlist database query.
-* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to
+* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to
tempoary passwords
=== Migrated extensions ===
* Moved password reset form from Special:Preferences to Special:ResetPass
* Added Special:ChangePassword as a special page alias for Special:ResetPass
* Added complimentary function for addHandler() called removeHandler() for removing events
-* Improved security of file uploads for IE clients, using a reverse-engineered
+* Improved security of file uploads for IE clients, using a reverse-engineered
algorithm very similar to IE's content detection algorithm.
* Cascading protection no longer requires that both edit and move are restricted
to sysop, just edit=sysop is enough
has been updated, and the 1.3 URL has been given. 1.2 is still Wikipedia-compatible.
RightsCode was changed from 'gfdl' to 'gfdl1_2', so we can now support 1.2 as well
as 1.3 (gfdl1_3).
-* (bug 16293) PD URL was changed to the CreativeCommons site on PD (which auto-detects
+* (bug 16293) PD URL was changed to the CreativeCommons site on PD (which auto-detects
your language) instead of Wikipedia.
* (bug 16635) The "view and edit watchlist" page (Special:Watchlist/edit) now
includes a table of contents
had marked them as having created another account, when their last account
creation had actually failed.
* (bug 12647) Allow autogenerated edit summary messages to be blanked with '-'
-* (bug 16026) 'Revision-info' and 'revision-info-current' both accept wiki
+* (bug 16026) 'Revision-info' and 'revision-info-current' both accept wiki
markup now.
* (bug 16529) Fix for search suggestions with some third-party JS libraries
* (bug 13342) importScript() generates more consistent URI encoding
* (bug 5506) Links to files on foreign repositories are now shown consistently
as bluelinks e.g. in logs and edit summaries
* (bug 16623) Add missing </p> tag in Special:LockDB
-* (bug 15849) Special:Movepage now throws a more specific error when trying to
+* (bug 15849) Special:Movepage now throws a more specific error when trying to
move a title to an interwiki target
* (bug 16638) 8-bit URL fallback encoding now set on additional languages using
Arabic script (Persian, Urdu, Sindhi, Punjabi)
that STDIN can be used for page list
* Sanitizer::decodeCharReferences() now decodes the XHTML "'" character
entity (loosely related to bug 14365)
+* (bug 16560) Special:Random returns a page from ContentNamespaces, and no
+ longer from NS_MAIN
=== API changes in 1.14 ===
* (bug 16515) Added pst and onlypst parameters to action=parse
* (bug 16541) Added block expiry timestamp to list=logevents output
* (bug 16613) action=protect doesn't tell when &cascade was set but cascading
- protection wasn't allowed
+ protection wasn't allowed
* (bug 16626) action=delete now correctly handles empty "reason" param
* (bug 15579) clshow considers all categories !hidden
* (bug 16647) list=allcategories, prop=categories don't return "hidden"
* @license GNU General Public Licence 2.0 or later
*/
class RandomPage extends SpecialPage {
- private $namespace = NS_MAIN; // namespace to select pages from
+ private $namespaces; // namespaces to select pages from
function __construct( $name = 'Randompage' ){
+ global $wgContentNamespaces;
+
+ $this->namespaces = $wgContentNamespaces;
+
parent::__construct( $name );
}
- public function getNamespace() {
- return $this->namespace;
+ public function getNamespaces() {
+ return $this->namespaces;
}
public function setNamespace ( $ns ) {
if( $ns < NS_MAIN ) $ns = NS_MAIN;
- $this->namespace = $ns;
+ $this->namespaces = array( $ns );
}
// select redirects instead of normal pages?
$row = $this->selectRandomPageFromDB( "0" );
if( $row )
- return Title::makeTitleSafe( $this->namespace, $row->page_title );
+ return Title::makeTitleSafe( $row->page_namespace, $row->page_title );
else
return null;
}
$use_index = $dbr->useIndexClause( 'page_random' );
$page = $dbr->tableName( 'page' );
- $ns = (int) $this->namespace;
+ $ns = implode( ",", $this->namespaces );
$redirect = $this->isRedirect() ? 1 : 0;
$extra = $wgExtraRandompageSQL ? "AND ($wgExtraRandompageSQL)" : "";
- $sql = "SELECT page_title
+ $sql = "SELECT page_title, page_namespace
FROM $page $use_index
- WHERE page_namespace = $ns
+ WHERE page_namespace IN ( $ns )
AND page_is_redirect = $redirect
AND page_random >= $randstr
$extra