Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -211,8 +211,6 @@ |
212 | 212 | {{NAMESPACE}} relative to correct title. |
213 | 213 | * (bug 30485 and bug 33434) Style rules for wikitable are now more specific and |
214 | 214 | prevent inheritance to nested tables which caused various issues |
215 | | -* (bug 32686) Tooltip on links to non-existing pages are now always in user's |
216 | | - language |
217 | 215 | * (bug 33454) ISO-8601 week-based year number (format character 'o') is now |
218 | 216 | calculated correctly with respect to timezone |
219 | 217 | * (bug 32219) InstantCommons now fetches content from Wikimedia Commons using |
Index: trunk/phase3/includes/parser/LinkHolderArray.php |
— | — | @@ -363,8 +363,7 @@ |
364 | 364 | if ( $colours[$pdbk] == 'new' ) { |
365 | 365 | $linkCache->addBadLinkObj( $title ); |
366 | 366 | $output->addLink( $title, 0 ); |
367 | | - $type = array( 'broken', |
368 | | - 'language' => $this->parent->getOptions()->getUserLangObj() ); |
| 367 | + $type = array( 'broken' ); |
369 | 368 | } else { |
370 | 369 | if ( $colours[$pdbk] != '' ) { |
371 | 370 | $attribs['class'] = $colours[$pdbk]; |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -154,20 +154,15 @@ |
155 | 155 | * @param $query array The query string to append to the URL |
156 | 156 | * you're linking to, in key => value array form. Query keys and values |
157 | 157 | * will be URL-encoded. |
158 | | - * @param $options string|array String or array: |
159 | | - * - Either with numerical index and following values: |
160 | | - * - 'known': Page is known to exist, so don't check if it does. |
161 | | - * - 'broken': Page is known not to exist, so don't check if it does. |
162 | | - * - 'noclasses': Don't add any classes automatically (includes "new", |
| 158 | + * @param $options string|array String or array of strings: |
| 159 | + * 'known': Page is known to exist, so don't check if it does. |
| 160 | + * 'broken': Page is known not to exist, so don't check if it does. |
| 161 | + * 'noclasses': Don't add any classes automatically (includes "new", |
163 | 162 | * "stub", "mw-redirect", "extiw"). Only use the class attribute |
164 | 163 | * provided, if any, so you get a simple blue link with no funny i- |
165 | 164 | * cons. |
166 | | - * - 'forcearticlepath': Use the article path always, even with a querystring. |
| 165 | + * 'forcearticlepath': Use the article path always, even with a querystring. |
167 | 166 | * Has compatibility issues on some setups, so avoid wherever possible. |
168 | | - * - Or with following indexes: |
169 | | - * - 'language': the value of that index is the language to use; currently |
170 | | - * only used for the tooltip when linking to a page that doesn't exist |
171 | | - * (since 1.19) |
172 | 167 | * @return string HTML <a> attribute |
173 | 168 | */ |
174 | 169 | public static function link( |
— | — | @@ -194,7 +189,7 @@ |
195 | 190 | |
196 | 191 | # If we don't know whether the page exists, let's find out. |
197 | 192 | wfProfileIn( __METHOD__ . '-checkPageExistence' ); |
198 | | - if ( !in_array( 'known', $options, true ) && !in_array( 'broken', $options, true ) ) { |
| 193 | + if ( !in_array( 'known', $options ) and !in_array( 'broken', $options ) ) { |
199 | 194 | if ( $target->isKnown() ) { |
200 | 195 | $options[] = 'known'; |
201 | 196 | } else { |
— | — | @@ -204,14 +199,14 @@ |
205 | 200 | wfProfileOut( __METHOD__ . '-checkPageExistence' ); |
206 | 201 | |
207 | 202 | $oldquery = array(); |
208 | | - if ( in_array( 'forcearticlepath', $options, true ) && $query ) { |
| 203 | + if ( in_array( "forcearticlepath", $options ) && $query ) { |
209 | 204 | $oldquery = $query; |
210 | 205 | $query = array(); |
211 | 206 | } |
212 | 207 | |
213 | 208 | # Note: we want the href attribute first, for prettiness. |
214 | 209 | $attribs = array( 'href' => self::linkUrl( $target, $query, $options ) ); |
215 | | - if ( in_array( 'forcearticlepath', $options, true ) && $oldquery ) { |
| 210 | + if ( in_array( 'forcearticlepath', $options ) && $oldquery ) { |
216 | 211 | $attribs['href'] = wfAppendQuery( $attribs['href'], wfArrayToCgi( $oldquery ) ); |
217 | 212 | } |
218 | 213 | |
— | — | @@ -251,7 +246,7 @@ |
252 | 247 | wfProfileIn( __METHOD__ ); |
253 | 248 | # We don't want to include fragments for broken links, because they |
254 | 249 | # generally make no sense. |
255 | | - if ( in_array( 'broken', $options, true ) && $target->mFragment !== '' ) { |
| 250 | + if ( in_array( 'broken', $options ) && $target->mFragment !== '' ) { |
256 | 251 | $target = clone $target; |
257 | 252 | $target->mFragment = ''; |
258 | 253 | } |
— | — | @@ -259,7 +254,7 @@ |
260 | 255 | # If it's a broken link, add the appropriate query pieces, unless |
261 | 256 | # there's already an action specified, or unless 'edit' makes no sense |
262 | 257 | # (i.e., for a nonexistent special page). |
263 | | - if ( in_array( 'broken', $options, true ) && empty( $query['action'] ) |
| 258 | + if ( in_array( 'broken', $options ) && empty( $query['action'] ) |
264 | 259 | && !$target->isSpecialPage() ) { |
265 | 260 | $query['action'] = 'edit'; |
266 | 261 | $query['redlink'] = '1'; |
— | — | @@ -279,22 +274,24 @@ |
280 | 275 | * @return array |
281 | 276 | */ |
282 | 277 | private static function linkAttribs( $target, $attribs, $options ) { |
283 | | - global $wgUser; |
284 | | - |
285 | 278 | wfProfileIn( __METHOD__ ); |
286 | | - |
| 279 | + global $wgUser; |
287 | 280 | $defaults = array(); |
288 | 281 | |
289 | | - if ( !in_array( 'noclasses', $options, true ) ) { |
| 282 | + if ( !in_array( 'noclasses', $options ) ) { |
290 | 283 | wfProfileIn( __METHOD__ . '-getClasses' ); |
291 | 284 | # Now build the classes. |
292 | 285 | $classes = array(); |
293 | 286 | |
| 287 | + if ( in_array( 'broken', $options ) ) { |
| 288 | + $classes[] = 'new'; |
| 289 | + } |
| 290 | + |
294 | 291 | if ( $target->isExternal() ) { |
295 | 292 | $classes[] = 'extiw'; |
296 | | - } elseif ( in_array( 'broken', $options, true ) ) { |
297 | | - $classes[] = 'new'; |
298 | | - } else { # Avoid useless calls to LinkCache (see r50387) |
| 293 | + } |
| 294 | + |
| 295 | + if ( !in_array( 'broken', $options ) ) { # Avoid useless calls to LinkCache (see r50387) |
299 | 296 | $colour = self::getLinkColour( $target, $wgUser->getStubThreshold() ); |
300 | 297 | if ( $colour !== '' ) { |
301 | 298 | $classes[] = $colour; # mw-redirect or stub |
— | — | @@ -310,14 +307,10 @@ |
311 | 308 | if ( $target->getPrefixedText() == '' ) { |
312 | 309 | # A link like [[#Foo]]. This used to mean an empty title |
313 | 310 | # attribute, but that's silly. Just don't output a title. |
314 | | - } elseif ( in_array( 'known', $options, true ) ) { |
| 311 | + } elseif ( in_array( 'known', $options ) ) { |
315 | 312 | $defaults['title'] = $target->getPrefixedText(); |
316 | 313 | } else { |
317 | | - $msg = wfMessage( 'red-link-title', $target->getPrefixedText() ); |
318 | | - if ( isset( $options['language'] ) ) { |
319 | | - $msg->inLanguage( $options['language'] ); |
320 | | - } |
321 | | - $defaults['title'] = $msg->text(); |
| 314 | + $defaults['title'] = wfMsg( 'red-link-title', $target->getPrefixedText() ); |
322 | 315 | } |
323 | 316 | |
324 | 317 | # Finally, merge the custom attribs with the default ones, and iterate |