*
* @param $name String
* @param $subpage String|Bool subpage string, or false to not use a subpage
+ * @param $fragment String the link fragment (after the "#")
* @throws MWException
* @return Title object
*/
- public static function getTitleFor( $name, $subpage = false ) {
+ public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
$name = SpecialPageFactory::getLocalNameFor( $name, $subpage );
if ( $name ) {
- return Title::makeTitle( NS_SPECIAL, $name );
+ return Title::makeTitle( NS_SPECIAL, $name, $fragment );
} else {
throw new MWException( "Invalid special page name \"$name\"" );
}
return false;
}
+ /**
+ * Is this page cached?
+ * Expensive pages are cached or disabled in miser mode.
+ * Used by QueryPage and subclasses, moved here so that
+ * Special:SpecialPages can safely call it for all special pages.
+ *
+ * @return Boolean
+ * @since 1.21
+ */
+ public function isCached() {
+ return false;
+ }
+
/**
* Can be overridden by subclasses with more complicated permissions
* schemes.
*/
public function isRestricted() {
// DWIM: If all anons can do something, then it is not restricted
- return $this->mRestriction != '' && User::groupHasPermission( '*', $this->mRestriction );
+ return $this->mRestriction != '' && !User::groupHasPermission( '*', $this->mRestriction );
}
/**
if ( $redirect instanceof Title ) {
$url = $redirect->getFullUrl( $query );
$this->getOutput()->redirect( $url );
- wfProfileOut( __METHOD__ );
return $redirect;
// Redirect to index.php with query parameters
} elseif ( $redirect === true ) {
global $wgScript;
$url = $wgScript . '?' . wfArrayToCGI( $query );
$this->getOutput()->redirect( $url );
- wfProfileOut( __METHOD__ );
return $redirect;
} else {
$class = __CLASS__;
'ctype', 'maxage', 'smaxage',
);
- wfRunHooks( "RedirectSpecialArticleRedirectParams", array(&$redirectParams) );
+ wfRunHooks( "RedirectSpecialArticleRedirectParams", array( &$redirectParams ) );
$this->mAllowedRedirectParams = $redirectParams;
}
}