summaryrefslogtreecommitdiff
path: root/includes/SpecialRandomredirect.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
commit086ae52d12011746a75f5588e877347bc0457352 (patch)
treee73263c7a29d0f94fafb874562610e16eb292ba8 /includes/SpecialRandomredirect.php
parent749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff)
Update auf MediaWiki 1.12.0
Diffstat (limited to 'includes/SpecialRandomredirect.php')
-rw-r--r--includes/SpecialRandomredirect.php27
1 files changed, 7 insertions, 20 deletions
diff --git a/includes/SpecialRandomredirect.php b/includes/SpecialRandomredirect.php
index b7aa3e49..ccf5cbcd 100644
--- a/includes/SpecialRandomredirect.php
+++ b/includes/SpecialRandomredirect.php
@@ -7,27 +7,14 @@
* @author Rob Church <robchur@gmail.com>, Ilmari Karonen
* @license GNU General Public Licence 2.0 or later
*/
-
-/**
- * Main execution point
- * @param $par Namespace to select the redirect from
- */
-function wfSpecialRandomredirect( $par = null ) {
- global $wgOut, $wgContLang;
-
- $rnd = new RandomPage();
- $rnd->setNamespace( $wgContLang->getNsIndex( $par ) );
- $rnd->setRedirect( true );
-
- $title = $rnd->getRandomTitle();
-
- if( is_null( $title ) ) {
- $wgOut->addWikiText( wfMsg( 'randomredirect-nopages' ) );
- return;
+class SpecialRandomredirect extends RandomPage {
+ function __construct(){
+ parent::__construct( 'Randomredirect' );
}
- $wgOut->reportTime();
- $wgOut->redirect( $title->getFullUrl( 'redirect=no' ) );
+ // Override parent::isRedirect()
+ public function isRedirect(){
+ return true;
+ }
}
-