Index: trunk/phase3/CREDITS |
— | — | @@ -63,6 +63,7 @@ |
64 | 64 | * Happy-melon |
65 | 65 | * Jeremy Baron |
66 | 66 | * Juliano F. Ravasi |
| 67 | +* Lucas Garczewski |
67 | 68 | * Louperivois |
68 | 69 | * Marooned |
69 | 70 | * Max Semenik |
Index: trunk/phase3/includes/specials/SpecialRandompage.php |
— | — | @@ -8,19 +8,23 @@ |
9 | 9 | * @license GNU General Public Licence 2.0 or later |
10 | 10 | */ |
11 | 11 | class RandomPage extends SpecialPage { |
12 | | - private $namespace = NS_MAIN; // namespace to select pages from |
| 12 | + private $namespaces; // namespaces to select pages from |
13 | 13 | |
14 | 14 | function __construct( $name = 'Randompage' ){ |
| 15 | + global $wgContentNamespaces; |
| 16 | + |
| 17 | + $this->namespaces = $wgContentNamespaces; |
| 18 | + |
15 | 19 | parent::__construct( $name ); |
16 | 20 | } |
17 | 21 | |
18 | | - public function getNamespace() { |
19 | | - return $this->namespace; |
| 22 | + public function getNamespaces() { |
| 23 | + return $this->namespaces; |
20 | 24 | } |
21 | 25 | |
22 | 26 | public function setNamespace ( $ns ) { |
23 | 27 | if( $ns < NS_MAIN ) $ns = NS_MAIN; |
24 | | - $this->namespace = $ns; |
| 28 | + $this->namespaces = array( $ns ); |
25 | 29 | } |
26 | 30 | |
27 | 31 | // select redirects instead of normal pages? |
— | — | @@ -67,7 +71,7 @@ |
68 | 72 | $row = $this->selectRandomPageFromDB( "0" ); |
69 | 73 | |
70 | 74 | if( $row ) |
71 | | - return Title::makeTitleSafe( $this->namespace, $row->page_title ); |
| 75 | + return Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
72 | 76 | else |
73 | 77 | return null; |
74 | 78 | } |
— | — | @@ -81,13 +85,13 @@ |
82 | 86 | $use_index = $dbr->useIndexClause( 'page_random' ); |
83 | 87 | $page = $dbr->tableName( 'page' ); |
84 | 88 | |
85 | | - $ns = (int) $this->namespace; |
| 89 | + $ns = implode( ",", $this->namespaces ); |
86 | 90 | $redirect = $this->isRedirect() ? 1 : 0; |
87 | 91 | |
88 | 92 | $extra = $wgExtraRandompageSQL ? "AND ($wgExtraRandompageSQL)" : ""; |
89 | | - $sql = "SELECT page_title |
| 93 | + $sql = "SELECT page_title, page_namespace |
90 | 94 | FROM $page $use_index |
91 | | - WHERE page_namespace = $ns |
| 95 | + WHERE page_namespace IN ( $ns ) |
92 | 96 | AND page_is_redirect = $redirect |
93 | 97 | AND page_random >= $randstr |
94 | 98 | $extra |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | * The 'BeforeWatchlist' hook has been removed due to internal changes in |
73 | 73 | Special:Watchlist. 'SpecialWatchlistQuery' should now be used by extensions |
74 | 74 | to customize the watchlist database query. |
75 | | -* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to |
| 75 | +* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to |
76 | 76 | tempoary passwords |
77 | 77 | |
78 | 78 | === Migrated extensions === |
— | — | @@ -221,7 +221,7 @@ |
222 | 222 | * Moved password reset form from Special:Preferences to Special:ResetPass |
223 | 223 | * Added Special:ChangePassword as a special page alias for Special:ResetPass |
224 | 224 | * Added complimentary function for addHandler() called removeHandler() for removing events |
225 | | -* Improved security of file uploads for IE clients, using a reverse-engineered |
| 225 | +* Improved security of file uploads for IE clients, using a reverse-engineered |
226 | 226 | algorithm very similar to IE's content detection algorithm. |
227 | 227 | * Cascading protection no longer requires that both edit and move are restricted |
228 | 228 | to sysop, just edit=sysop is enough |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | has been updated, and the 1.3 URL has been given. 1.2 is still Wikipedia-compatible. |
232 | 232 | RightsCode was changed from 'gfdl' to 'gfdl1_2', so we can now support 1.2 as well |
233 | 233 | as 1.3 (gfdl1_3). |
234 | | -* (bug 16293) PD URL was changed to the CreativeCommons site on PD (which auto-detects |
| 234 | +* (bug 16293) PD URL was changed to the CreativeCommons site on PD (which auto-detects |
235 | 235 | your language) instead of Wikipedia. |
236 | 236 | * (bug 16635) The "view and edit watchlist" page (Special:Watchlist/edit) now |
237 | 237 | includes a table of contents |
— | — | @@ -425,7 +425,7 @@ |
426 | 426 | had marked them as having created another account, when their last account |
427 | 427 | creation had actually failed. |
428 | 428 | * (bug 12647) Allow autogenerated edit summary messages to be blanked with '-' |
429 | | -* (bug 16026) 'Revision-info' and 'revision-info-current' both accept wiki |
| 429 | +* (bug 16026) 'Revision-info' and 'revision-info-current' both accept wiki |
430 | 430 | markup now. |
431 | 431 | * (bug 16529) Fix for search suggestions with some third-party JS libraries |
432 | 432 | * (bug 13342) importScript() generates more consistent URI encoding |
— | — | @@ -441,7 +441,7 @@ |
442 | 442 | * (bug 5506) Links to files on foreign repositories are now shown consistently |
443 | 443 | as bluelinks e.g. in logs and edit summaries |
444 | 444 | * (bug 16623) Add missing </p> tag in Special:LockDB |
445 | | -* (bug 15849) Special:Movepage now throws a more specific error when trying to |
| 445 | +* (bug 15849) Special:Movepage now throws a more specific error when trying to |
446 | 446 | move a title to an interwiki target |
447 | 447 | * (bug 16638) 8-bit URL fallback encoding now set on additional languages using |
448 | 448 | Arabic script (Persian, Urdu, Sindhi, Punjabi) |
— | — | @@ -471,6 +471,8 @@ |
472 | 472 | that STDIN can be used for page list |
473 | 473 | * Sanitizer::decodeCharReferences() now decodes the XHTML "'" character |
474 | 474 | entity (loosely related to bug 14365) |
| 475 | +* (bug 16560) Special:Random returns a page from ContentNamespaces, and no |
| 476 | + longer from NS_MAIN |
475 | 477 | |
476 | 478 | === API changes in 1.14 === |
477 | 479 | |
— | — | @@ -570,7 +572,7 @@ |
571 | 573 | * (bug 16515) Added pst and onlypst parameters to action=parse |
572 | 574 | * (bug 16541) Added block expiry timestamp to list=logevents output |
573 | 575 | * (bug 16613) action=protect doesn't tell when &cascade was set but cascading |
574 | | - protection wasn't allowed |
| 576 | + protection wasn't allowed |
575 | 577 | * (bug 16626) action=delete now correctly handles empty "reason" param |
576 | 578 | * (bug 15579) clshow considers all categories !hidden |
577 | 579 | * (bug 16647) list=allcategories, prop=categories don't return "hidden" |