Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -167,6 +167,8 @@ |
168 | 168 | * The API now respects $wgShowHostnames and won't share the hostname in |
169 | 169 | severedby if it's set to false |
170 | 170 | * wlexcludeuser parameter added to ApiFeedWatchlist |
| 171 | +* (bug 7304) Links on redirect pages no longer cause the redirect page to show |
| 172 | + up as a redirect to the linked page on Special:Whatlinkshere |
171 | 173 | |
172 | 174 | === Languages updated in 1.19 === |
173 | 175 | |
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -119,9 +119,9 @@ |
120 | 120 | 'pl_title' => $target->getDBkey(), |
121 | 121 | ); |
122 | 122 | if( $hideredirs ) { |
123 | | - $plConds['page_is_redirect'] = 0; |
| 123 | + $plConds['rd_from'] = null; |
124 | 124 | } elseif( $hidelinks ) { |
125 | | - $plConds['page_is_redirect'] = 1; |
| 125 | + $plConds[] = 'rd_from is NOT NULL'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | $tlConds = array( |
— | — | @@ -156,24 +156,34 @@ |
157 | 157 | $options[] = 'STRAIGHT_JOIN'; |
158 | 158 | |
159 | 159 | $options['LIMIT'] = $queryLimit; |
160 | | - $fields = array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' ); |
| 160 | + $fields = array( 'page_id', 'page_namespace', 'page_title', 'rd_from' ); |
161 | 161 | |
| 162 | + $joinConds = array( 'redirect' => array( 'LEFT JOIN', array( |
| 163 | + 'rd_from = page_id', |
| 164 | + 'rd_namespace' => $target->getNamespace(), |
| 165 | + 'rd_title' => $target->getDBkey(), |
| 166 | + '(rd_interwiki is NULL) or (rd_interwiki = \'\')' |
| 167 | + ))); |
| 168 | + |
162 | 169 | if( $fetchlinks ) { |
163 | 170 | $options['ORDER BY'] = 'pl_from'; |
164 | | - $plRes = $dbr->select( array( 'pagelinks', 'page' ), $fields, |
165 | | - $plConds, __METHOD__, $options ); |
| 171 | + $plRes = $dbr->select( array( 'pagelinks', 'page', 'redirect' ), $fields, |
| 172 | + $plConds, __METHOD__, $options, |
| 173 | + $joinConds); |
166 | 174 | } |
167 | 175 | |
168 | 176 | if( !$hidetrans ) { |
169 | 177 | $options['ORDER BY'] = 'tl_from'; |
170 | | - $tlRes = $dbr->select( array( 'templatelinks', 'page' ), $fields, |
171 | | - $tlConds, __METHOD__, $options ); |
| 178 | + $tlRes = $dbr->select( array( 'templatelinks', 'page', 'redirect' ), $fields, |
| 179 | + $tlConds, __METHOD__, $options, |
| 180 | + $joinConds); |
172 | 181 | } |
173 | 182 | |
174 | 183 | if( !$hideimages ) { |
175 | 184 | $options['ORDER BY'] = 'il_from'; |
176 | | - $ilRes = $dbr->select( array( 'imagelinks', 'page' ), $fields, |
177 | | - $ilConds, __METHOD__, $options ); |
| 185 | + $ilRes = $dbr->select( array( 'imagelinks', 'page', 'redirect' ), $fields, |
| 186 | + $ilConds, __METHOD__, $options, |
| 187 | + $joinConds); |
178 | 188 | } |
179 | 189 | |
180 | 190 | if( ( !$fetchlinks || !$dbr->numRows($plRes) ) && ( $hidetrans || !$dbr->numRows($tlRes) ) && ( $hideimages || !$dbr->numRows($ilRes) ) ) { |
— | — | @@ -247,7 +257,7 @@ |
248 | 258 | foreach ( $rows as $row ) { |
249 | 259 | $nt = Title::makeTitle( $row->page_namespace, $row->page_title ); |
250 | 260 | |
251 | | - if ( $row->page_is_redirect && $level < 2 ) { |
| 261 | + if ( $row->rd_from && $level < 2 ) { |
252 | 262 | $out->addHTML( $this->listItem( $row, $nt, true ) ); |
253 | 263 | $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved ); |
254 | 264 | $out->addHTML( Xml::closeElement( 'li' ) ); |
— | — | @@ -281,7 +291,7 @@ |
282 | 292 | } |
283 | 293 | } |
284 | 294 | |
285 | | - if( $row->page_is_redirect ) { |
| 295 | + if( $row->rd_from ) { |
286 | 296 | $query = array( 'redirect' => 'no' ); |
287 | 297 | } else { |
288 | 298 | $query = array(); |
— | — | @@ -297,7 +307,7 @@ |
298 | 308 | // Display properties (redirect or template) |
299 | 309 | $propsText = ''; |
300 | 310 | $props = array(); |
301 | | - if ( $row->page_is_redirect ) |
| 311 | + if ( $row->rd_from ) |
302 | 312 | $props[] = $msgcache['isredirect']; |
303 | 313 | if ( $row->is_template ) |
304 | 314 | $props[] = $msgcache['istemplate']; |