Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | wfRunHooks( 'BeforeInitialize', array( &$title, &$article, &$output, &$user, $request, $this ) ); |
58 | 58 | |
59 | | - if( !$this->preliminaryChecks( $title, $output, $request ) ) { |
| 59 | + if( !$this->preliminaryChecks( $title, $output ) ) { |
60 | 60 | wfProfileOut( __METHOD__ ); |
61 | 61 | return; |
62 | 62 | } |
— | — | @@ -110,7 +110,12 @@ |
111 | 111 | } |
112 | 112 | |
113 | 113 | $curid = $wgRequest->getInt( 'curid' ); |
114 | | - if( $curid ) { |
| 114 | + if( $wgRequest->getCheck( 'search' ) ) { |
| 115 | + // Compatibility with old search URLs which didn't use Special:Search |
| 116 | + // Just check for presence here, so blank requests still |
| 117 | + // show the search page when using ugly URLs (bug 8054). |
| 118 | + $ret = SpecialPage::getTitleFor( 'Search' ); |
| 119 | + } elseif( $curid ) { |
115 | 120 | // URLs like this are generated by RC, because rc_title isn't always accurate |
116 | 121 | $ret = Title::newFromID( $curid ); |
117 | 122 | } elseif( $title == '' && $action != 'delete' ) { |
— | — | @@ -137,22 +142,13 @@ |
138 | 143 | } |
139 | 144 | |
140 | 145 | /** |
141 | | - * Checks for search query and anon-cannot-read case |
| 146 | + * Checks for anon-cannot-read case |
142 | 147 | * |
143 | 148 | * @param $title Title |
144 | 149 | * @param $output OutputPage |
145 | | - * @param $request WebRequest |
146 | 150 | * @return boolean true if successful |
147 | 151 | */ |
148 | | - function preliminaryChecks( &$title, &$output, $request ) { |
149 | | - if( $request->getCheck( 'search' ) ) { |
150 | | - // Compatibility with old search URLs which didn't use Special:Search |
151 | | - // Just check for presence here, so blank requests still |
152 | | - // show the search page when using ugly URLs (bug 8054). |
153 | | - |
154 | | - // Do this above the read whitelist check for security... |
155 | | - $title = SpecialPage::getTitleFor( 'Search' ); |
156 | | - } |
| 152 | + function preliminaryChecks( &$title, &$output ) { |
157 | 153 | // If the user is not logged in, the Namespace:title of the article must be in |
158 | 154 | // the Read array in order for the user to see it. (We have to check here to |
159 | 155 | // catch special pages etc. We check again in Article::view()) |