wfRunHooks( 'BeforeInitialize', array( &$title, &$article, &$output, &$user, $request, $this ) );
- if( !$this->preliminaryChecks( $title, $output, $request ) ) {
+ if( !$this->preliminaryChecks( $title, $output ) ) {
wfProfileOut( __METHOD__ );
return;
}
}
$curid = $wgRequest->getInt( 'curid' );
- if( $curid ) {
+ if( $wgRequest->getCheck( 'search' ) ) {
+ // Compatibility with old search URLs which didn't use Special:Search
+ // Just check for presence here, so blank requests still
+ // show the search page when using ugly URLs (bug 8054).
+ $ret = SpecialPage::getTitleFor( 'Search' );
+ } elseif( $curid ) {
// URLs like this are generated by RC, because rc_title isn't always accurate
$ret = Title::newFromID( $curid );
} elseif( $title == '' && $action != 'delete' ) {
}
/**
- * Checks for search query and anon-cannot-read case
+ * Checks for anon-cannot-read case
*
* @param $title Title
* @param $output OutputPage
- * @param $request WebRequest
* @return boolean true if successful
*/
- function preliminaryChecks( &$title, &$output, $request ) {
- if( $request->getCheck( 'search' ) ) {
- // Compatibility with old search URLs which didn't use Special:Search
- // Just check for presence here, so blank requests still
- // show the search page when using ugly URLs (bug 8054).
-
- // Do this above the read whitelist check for security...
- $title = SpecialPage::getTitleFor( 'Search' );
- }
+ function preliminaryChecks( &$title, &$output ) {
// If the user is not logged in, the Namespace:title of the article must be in
// the Read array in order for the user to see it. (We have to check here to
// catch special pages etc. We check again in Article::view())