* @ingroup SpecialPage
*/
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
-
// Query parameters that can be passed through redirects
protected $mAllowedRedirectParams = array();
if ( $redirect instanceof Title ) {
$url = $redirect->getFullURL( $query );
$this->getOutput()->redirect( $url );
+
return $redirect;
} elseif ( $redirect === true ) {
// Redirect to index.php with query parameters
$url = wfAppendQuery( wfScript( 'index' ), $query );
$this->getOutput()->redirect( $url );
+
return $redirect;
} else {
$class = get_class( $this );
* @ingroup SpecialPage
*/
abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
- // @todo FIXME: Visibility must be declared
- var $redirName, $redirSubpage;
+ /** @var string Name of redirect target */
+ protected $redirName;
+
+ /** @var string Name of subpage of redirect target */
+ protected $redirSubpage;
function __construct(
$name, $redirName, $redirSubpage = false,
*
* @par Hook extension example:
* @code
- * $wgHooks['RedirectSpecialArticleRedirectParams'][] =
- * 'MyExtensionHooks::onRedirectSpecialArticleRedirectParams';
- * public static function onRedirectSpecialArticleRedirectParams( &$redirectParams ) {
- * $redirectParams[] = 'stable';
- * return true;
- * }
+ * $wgHooks['RedirectSpecialArticleRedirectParams'][] =
+ * 'MyExtensionHooks::onRedirectSpecialArticleRedirectParams';
+ * public static function onRedirectSpecialArticleRedirectParams( &$redirectParams ) {
+ * $redirectParams[] = 'stable';
+ * return true;
+ * }
* @endcode
*
* @ingroup SpecialPage