Index: trunk/phase3/maintenance/parserTests.php |
— | — | @@ -302,6 +302,7 @@ |
303 | 303 | 'wgCapitalLinks' => true, |
304 | 304 | 'wgDefaultUserOptions' => array(), |
305 | 305 | 'wgNoFollowLinks' => true, |
| 306 | + 'wgThumbnailScriptPath' => false, |
306 | 307 | ); |
307 | 308 | $this->savedGlobals = array(); |
308 | 309 | foreach( $settings as $var => $val ) { |
Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -1658,7 +1658,7 @@ |
1659 | 1659 | !! input |
1660 | 1660 | [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] |
1661 | 1661 | !! result |
1662 | | -<div class="thumb tright"><div style="width:182px;"><b>Missing image</b><br /><i>Foobar.jpg</i> <div class="thumbcaption" >This is a caption with another <a href="https://www.mediawiki.org/wiki/Image:Icon.png" class="image" title="image"><img src="/images/9/96/Icon.png" alt="image" longdesc="/wiki/Image:Icon.png" /></a> inside it!</div></div></div> |
| 1662 | +<div class="thumb tright"><div style="width:182px;"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="This is a caption with another Image:Icon.png inside it!"><img src="/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="This is a caption with another Image:Icon.png inside it!" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" ><div class="magnify" style="float:right"><a href="https://www.mediawiki.org/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Icon.png" class="new" title="Image:Icon.png">Image:Icon.png</a> inside it!</div></div></div> |
1663 | 1663 | |
1664 | 1664 | !! end |
1665 | 1665 | |
Index: trunk/phase3/includes/ParserXML.php |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | # There's stuff missing here... |
146 | 146 | if ($nt->getNamespace() == NS_IMAGE) { |
147 | 147 | $options[] = $display_title; |
148 | | - return $skin->makeImageLinkObj($nt, implode('|', $options)); |
| 148 | + return $parser->makeImage($nt, implode('|', $options)); |
149 | 149 | } else { |
150 | 150 | # Default |
151 | 151 | $title = $target; |
— | — | @@ -639,4 +639,4 @@ |
640 | 640 | } |
641 | 641 | |
642 | 642 | } |
643 | | -?> |
\ No newline at end of file |
| 643 | +?> |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -16,20 +16,14 @@ |
17 | 17 | * @package MediaWiki |
18 | 18 | */ |
19 | 19 | class Linker { |
20 | | - var $linktrail ; # linktrail regexp |
21 | | - var $postParseLinkColour = false; |
22 | 20 | |
23 | | - /** @todo document */ |
24 | | - function Linker() { |
25 | | - global $wgContLang; |
26 | | - $this->linktrail = $wgContLang->linkTrail(); |
27 | | - } |
28 | | - |
| 21 | + function Linker() {} |
| 22 | + |
29 | 23 | /** |
30 | | - * Get/set accessor for delayed link colouring |
| 24 | + * OBSOLETE |
31 | 25 | */ |
32 | | - function postParseLinkColour( $setting = NULL ) { |
33 | | - return wfSetVar( $this->postParseLinkColour, $setting ); |
| 26 | + function postParseLinkColour( $s = NULL ) { |
| 27 | + return NULL; |
34 | 28 | } |
35 | 29 | |
36 | 30 | /** @todo document */ |
— | — | @@ -137,12 +131,12 @@ |
138 | 132 | * Pass a title object, not a title string |
139 | 133 | */ |
140 | 134 | function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) { |
141 | | - global $wgOut, $wgUser, $wgLinkHolders, $wgInputEncoding; |
| 135 | + global $wgOut, $wgUser, $wgInputEncoding; |
142 | 136 | $fname = 'Skin::makeLinkObj'; |
143 | 137 | wfProfileIn( $fname ); |
144 | 138 | |
145 | 139 | # Fail gracefully |
146 | | - if ( ! isset($nt) ) { |
| 140 | + if ( ! is_object($nt) ) { |
147 | 141 | # wfDebugDieBacktrace(); |
148 | 142 | wfProfileOut( $fname ); |
149 | 143 | return "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
— | — | @@ -183,45 +177,10 @@ |
184 | 178 | |
185 | 179 | $t = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>"; |
186 | 180 | |
187 | | - if( $this->postParseLinkColour ) { |
188 | | - # There's no existence check, but this will prevent |
189 | | - # interwiki links from being parsed as external links. |
190 | | - global $wgInterwikiLinkHolders; |
191 | | - $nr = array_push($wgInterwikiLinkHolders, $t); |
192 | | - $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}"; |
193 | | - } else { |
194 | | - return $t; |
195 | | - } |
196 | | - } elseif ( 0 == $ns && "" == $dbkey ) { |
197 | | - # A self-link with a fragment; skip existence check. |
| 181 | + return $t; |
| 182 | + } elseif ( $nt->isAlwaysKnown() ) { |
| 183 | + # Image links, special page links and self-links with fragements are always known. |
198 | 184 | $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
199 | | - } elseif ( ( NS_SPECIAL == $ns ) || ( NS_IMAGE == $ns ) ) { |
200 | | - # These are always shown as existing, currently. |
201 | | - # Special pages don't exist in the database; images may |
202 | | - # occasionally be present when there is no description |
203 | | - # page per se, so we always shown them. |
204 | | - $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
205 | | - } elseif ( $this->postParseLinkColour ) { |
206 | | - wfProfileIn( $fname.'-postparse' ); |
207 | | - # Insert a placeholder, and we'll work out the existence checks |
208 | | - # in a big lump later. |
209 | | - $inside = ''; |
210 | | - if ( '' != $trail ) { |
211 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
212 | | - $inside = $m[1]; |
213 | | - $trail = $m[2]; |
214 | | - } |
215 | | - } |
216 | | - |
217 | | - # These get picked up by Parser::replaceLinkHolders() |
218 | | - $nr = array_push( $wgLinkHolders['namespaces'], $nt->getNamespace() ); |
219 | | - $wgLinkHolders['dbkeys'][] = $dbkey; |
220 | | - $wgLinkHolders['queries'][] = $query; |
221 | | - $wgLinkHolders['texts'][] = $prefix.$text.$inside; |
222 | | - $wgLinkHolders['titles'][] =& $nt; |
223 | | - |
224 | | - $retVal = '<!--LINK '. ($nr-1) ."-->{$trail}"; |
225 | | - wfProfileOut( $fname.'-postparse' ); |
226 | 185 | } else { |
227 | 186 | wfProfileIn( $fname.'-immediate' ); |
228 | 187 | # Work out link colour immediately |
— | — | @@ -294,14 +253,8 @@ |
295 | 254 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
296 | 255 | } |
297 | 256 | $style = $this->getInternalLinkAttributesObj( $nt, $text ); |
298 | | - |
299 | | - $inside = ''; |
300 | | - if ( '' != $trail ) { |
301 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
302 | | - $inside = $m[1]; |
303 | | - $trail = $m[2]; |
304 | | - } |
305 | | - } |
| 257 | + |
| 258 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
306 | 259 | $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}"; |
307 | 260 | wfProfileOut( $fname ); |
308 | 261 | return $r; |
— | — | @@ -331,14 +284,8 @@ |
332 | 285 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
333 | 286 | } |
334 | 287 | $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" ); |
335 | | - |
336 | | - $inside = ''; |
337 | | - if ( '' != $trail ) { |
338 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
339 | | - $inside = $m[1]; |
340 | | - $trail = $m[2]; |
341 | | - } |
342 | | - } |
| 288 | + |
| 289 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
343 | 290 | $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
344 | 291 | |
345 | 292 | wfProfileOut( $fname ); |
— | — | @@ -358,13 +305,7 @@ |
359 | 306 | } |
360 | 307 | $style = $this->getInternalLinkAttributesObj( $nt, $text, 'stub' ); |
361 | 308 | |
362 | | - $inside = ''; |
363 | | - if ( '' != $trail ) { |
364 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
365 | | - $inside = $m[1]; |
366 | | - $trail = $m[2]; |
367 | | - } |
368 | | - } |
| 309 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
369 | 310 | $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
370 | 311 | return $s; |
371 | 312 | } |
— | — | @@ -375,13 +316,7 @@ |
376 | 317 | if ( '' == $text ) { |
377 | 318 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
378 | 319 | } |
379 | | - $inside = ''; |
380 | | - if ( '' != $trail ) { |
381 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
382 | | - $inside = $m[1]; |
383 | | - $trail = $m[2]; |
384 | | - } |
385 | | - } |
| 320 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
386 | 321 | return "<strong>{$prefix}{$text}{$inside}</strong>{$trail}"; |
387 | 322 | } |
388 | 323 | |
— | — | @@ -396,8 +331,13 @@ |
397 | 332 | return htmlspecialchars( $basename ); |
398 | 333 | } |
399 | 334 | |
400 | | - /** @todo document */ |
| 335 | + /** Obsolete alias */ |
401 | 336 | function makeImage( $url, $alt = '' ) { |
| 337 | + return $this->makeExternalImage( $url, $alt ); |
| 338 | + } |
| 339 | + |
| 340 | + /** @todo document */ |
| 341 | + function makeExternalImage( $url, $alt = '' ) { |
402 | 342 | global $wgOut; |
403 | 343 | if ( '' == $alt ) { |
404 | 344 | $alt = $this->fnamePart( $url ); |
— | — | @@ -407,81 +347,15 @@ |
408 | 348 | } |
409 | 349 | |
410 | 350 | /** @todo document */ |
411 | | - function makeImageLink( $name, $url, $alt = '' ) { |
412 | | - $nt = Title::makeTitleSafe( NS_IMAGE, $name ); |
413 | | - return $this->makeImageLinkObj( $nt, $alt ); |
414 | | - } |
415 | | - |
416 | | - /** @todo document */ |
417 | | - function makeImageLinkObj( $nt, $alt = '' ) { |
418 | | - global $wgContLang, $wgUseImageResize; |
419 | | - global $wgUser, $wgThumbLimits; |
| 351 | + function makeImageLinkObj( &$nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false, |
| 352 | + $thumb = false, $manual_thumb = '' ) |
| 353 | + { |
| 354 | + global $wgContLang, $wgUser, $wgThumbLimits; |
420 | 355 | |
421 | 356 | $img = new Image( $nt ); |
422 | 357 | $url = $img->getViewURL(); |
423 | | - |
424 | | - $align = ''; |
425 | 358 | $prefix = $postfix = ''; |
426 | | - |
427 | | - # Check if the alt text is of the form "options|alt text" |
428 | | - # Options are: |
429 | | - # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
430 | | - # * left no resizing, just left align. label is used for alt= only |
431 | | - # * right same, but right aligned |
432 | | - # * none same, but not aligned |
433 | | - # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
434 | | - # * center center the image |
435 | | - # * framed Keep original image size, no magnify-button. |
436 | | - |
437 | | - $part = explode( '|', $alt); |
438 | | - |
439 | | - $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL ); |
440 | | - $mwLeft =& MagicWord::get( MAG_IMG_LEFT ); |
441 | | - $mwRight =& MagicWord::get( MAG_IMG_RIGHT ); |
442 | | - $mwNone =& MagicWord::get( MAG_IMG_NONE ); |
443 | | - $mwWidth =& MagicWord::get( MAG_IMG_WIDTH ); |
444 | | - $mwCenter =& MagicWord::get( MAG_IMG_CENTER ); |
445 | | - $mwFramed =& MagicWord::get( MAG_IMG_FRAMED ); |
446 | | - $alt = ''; |
447 | | - |
448 | | - $height = $framed = $thumb = false; |
449 | | - $manual_thumb = "" ; |
450 | | - |
451 | | - foreach( $part as $key => $val ) { |
452 | | - $val_parts = explode ( "=" , $val , 2 ) ; |
453 | | - $left_part = array_shift ( $val_parts ) ; |
454 | | - if ( $wgUseImageResize && ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) { |
455 | | - $thumb=true; |
456 | | - } elseif ( $wgUseImageResize && count ( $val_parts ) == 1 && ! is_null( $mwThumb->matchVariableStartToEnd($left_part) ) ) { |
457 | | - # use manually specified thumbnail |
458 | | - $thumb=true; |
459 | | - $manual_thumb = array_shift ( $val_parts ) ; |
460 | | - } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) { |
461 | | - # remember to set an alignment, don't render immediately |
462 | | - $align = 'right'; |
463 | | - } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) { |
464 | | - # remember to set an alignment, don't render immediately |
465 | | - $align = 'left'; |
466 | | - } elseif ( ! is_null( $mwCenter->matchVariableStartToEnd($val) ) ) { |
467 | | - # remember to set an alignment, don't render immediately |
468 | | - $align = 'center'; |
469 | | - } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) { |
470 | | - # remember to set an alignment, don't render immediately |
471 | | - $align = 'none'; |
472 | | - } elseif ( $wgUseImageResize && ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) { |
473 | | - # $match is the image width in pixels |
474 | | - if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) { |
475 | | - $width = intval( $m[1] ); |
476 | | - $height = intval( $m[2] ); |
477 | | - } else { |
478 | | - $width = intval($match); |
479 | | - } |
480 | | - } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) { |
481 | | - $framed=true; |
482 | | - } else { |
483 | | - $alt = $val; |
484 | | - } |
485 | | - } |
| 359 | + |
486 | 360 | if ( 'center' == $align ) |
487 | 361 | { |
488 | 362 | $prefix = '<div class="center">'; |
— | — | @@ -503,7 +377,7 @@ |
504 | 378 | } |
505 | 379 | |
506 | 380 | |
507 | | - if ( ! isset($width) ) { |
| 381 | + if ( $width === false ) { |
508 | 382 | $wopt = $wgUser->getOption( 'thumbsize' ); |
509 | 383 | |
510 | 384 | if( !isset( $wgThumbLimits[$wopt] ) ) { |
— | — | @@ -513,28 +387,21 @@ |
514 | 388 | $width = $wgThumbLimits[$wopt]; |
515 | 389 | } |
516 | 390 | |
517 | | - return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix; |
| 391 | + return $prefix.$this->makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix; |
518 | 392 | |
519 | | - } elseif ( isset($width) ) { |
| 393 | + } elseif ( $width ) { |
520 | 394 | |
521 | 395 | # Create a resized image, without the additional thumbnail |
522 | 396 | # features |
523 | 397 | |
524 | | - if ( ( ! $height === false ) |
525 | | - && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) { |
| 398 | + if ( $height !== false && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) { |
526 | 399 | $width = $img->getWidth() * $height / $img->getHeight(); |
527 | 400 | } |
528 | | - if ( '' == $manual_thumb ) $url = $img->createThumb( $width ); |
| 401 | + if ( '' == $manual_thumb ) { |
| 402 | + $url = $img->createThumb( $width ); |
| 403 | + } |
529 | 404 | } |
530 | 405 | |
531 | | - # FIXME: This is a gross hack using a global. |
532 | | - # Replace link color holders in the caption text so the |
533 | | - # text portion can be placed int the alt/title attributes. |
534 | | - global $wgParser; |
535 | | - $wgParser->replaceLinkHolders( $alt ); |
536 | | - |
537 | | - $alt = Sanitizer::stripAllTags( $alt ); |
538 | | - |
539 | 406 | $u = $nt->escapeLocalURL(); |
540 | 407 | if ( $url == '' ) { |
541 | 408 | $s = $this->makeBrokenImageLinkObj( $img->getTitle() ); |
— | — | @@ -553,14 +420,10 @@ |
554 | 421 | * Make HTML for a thumbnail including image, border and caption |
555 | 422 | * $img is an Image object |
556 | 423 | */ |
557 | | - function makeThumbLinkObj( $img, $label = '', $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) { |
| 424 | + function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) { |
558 | 425 | global $wgStylePath, $wgContLang; |
559 | | - # $image = Title::makeTitleSafe( NS_IMAGE, $name ); |
560 | 426 | $url = $img->getViewURL(); |
561 | 427 | |
562 | | - #$label = htmlspecialchars( $label ); |
563 | | - $alt = Sanitizer::stripAllTags( $label ); |
564 | | - |
565 | 428 | $width = $height = 0; |
566 | 429 | if ( $img->exists() ) |
567 | 430 | { |
— | — | @@ -661,14 +524,7 @@ |
662 | 525 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
663 | 526 | } |
664 | 527 | $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" ); |
665 | | - |
666 | | - $inside = ''; |
667 | | - if ( '' != $trail ) { |
668 | | - if ( preg_match( $this->linktrail, $trail, $m ) ) { |
669 | | - $inside = $m[1]; |
670 | | - $trail = $m[2]; |
671 | | - } |
672 | | - } |
| 528 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
673 | 529 | $s = "<a href=\"{$url}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
674 | 530 | |
675 | 531 | wfProfileOut( $fname ); |
— | — | @@ -920,5 +776,28 @@ |
921 | 777 | } |
922 | 778 | return "<div class=\"editsection\" style=\"float:$farside;margin-$nearside:5px;\">[".$url."]</div>"; |
923 | 779 | } |
| 780 | + |
| 781 | + /** |
| 782 | + * Split a link trail, return the "inside" portion and the remainder of the trail |
| 783 | + * as a two-element array |
| 784 | + * |
| 785 | + * @static |
| 786 | + */ |
| 787 | + function splitTrail( $trail ) { |
| 788 | + static $regex = false; |
| 789 | + if ( $regex === false ) { |
| 790 | + global $wgContLang; |
| 791 | + $regex = $wgContLang->linkTrail(); |
| 792 | + } |
| 793 | + $inside = ''; |
| 794 | + if ( '' != $trail ) { |
| 795 | + if ( preg_match( $regex, $trail, $m ) ) { |
| 796 | + $inside = $m[1]; |
| 797 | + $trail = $m[2]; |
| 798 | + } |
| 799 | + } |
| 800 | + return array( $inside, $trail ); |
| 801 | + } |
| 802 | + |
924 | 803 | } |
925 | 804 | ?> |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -101,6 +101,7 @@ |
102 | 102 | # Cleared with clearState(): |
103 | 103 | var $mOutput, $mAutonumber, $mDTopen, $mStripState = array(); |
104 | 104 | var $mVariables, $mIncludeCount, $mArgStack, $mLastSection, $mInPre; |
| 105 | + var $mInterwikiLinkHolders, $mLinkHolders; |
105 | 106 | |
106 | 107 | # Temporary: |
107 | 108 | var $mOptions, $mTitle, $mOutputType, |
— | — | @@ -117,6 +118,7 @@ |
118 | 119 | * @access public |
119 | 120 | */ |
120 | 121 | function Parser() { |
| 122 | + global $wgContLang; |
121 | 123 | $this->mTemplates = array(); |
122 | 124 | $this->mTemplatePath = array(); |
123 | 125 | $this->mTagHooks = array(); |
— | — | @@ -138,6 +140,14 @@ |
139 | 141 | $this->mStripState = array(); |
140 | 142 | $this->mArgStack = array(); |
141 | 143 | $this->mInPre = false; |
| 144 | + $this->mInterwikiLinkHolders = array(); |
| 145 | + $this->mLinkHolders = array( |
| 146 | + 'namespaces' => array(), |
| 147 | + 'dbkeys' => array(), |
| 148 | + 'queries' => array(), |
| 149 | + 'texts' => array(), |
| 150 | + 'titles' => array() |
| 151 | + ); |
142 | 152 | } |
143 | 153 | |
144 | 154 | /** |
— | — | @@ -166,7 +176,7 @@ |
167 | 177 | $this->mOutputType = OT_HTML; |
168 | 178 | |
169 | 179 | $this->mStripState = NULL; |
170 | | - global $fnord; $fnord = 1; |
| 180 | + |
171 | 181 | //$text = $this->strip( $text, $this->mStripState ); |
172 | 182 | // VOODOO MAGIC FIX! Sometimes the above segfaults in PHP5. |
173 | 183 | $x =& $this->mStripState; |
— | — | @@ -965,8 +975,6 @@ |
966 | 976 | wfProfileIn( $fname ); |
967 | 977 | |
968 | 978 | $sk =& $this->mOptions->getSkin(); |
969 | | - global $wgContLang; |
970 | | - $linktrail = $wgContLang->linkTrail(); |
971 | 979 | |
972 | 980 | $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); |
973 | 981 | |
— | — | @@ -989,7 +997,7 @@ |
990 | 998 | |
991 | 999 | # If the link text is an image URL, replace it with an <img> tag |
992 | 1000 | # This happened by accident in the original parser, but some people used it extensively |
993 | | - $img = $this->maybeMakeImageLink( $text ); |
| 1001 | + $img = $this->maybeMakeExternalImage( $text ); |
994 | 1002 | if ( $img !== false ) { |
995 | 1003 | $text = $img; |
996 | 1004 | } |
— | — | @@ -1013,17 +1021,14 @@ |
1014 | 1022 | } else { |
1015 | 1023 | # Have link text, e.g. [http://domain.tld/some.link text]s |
1016 | 1024 | # Check for trail |
1017 | | - if ( preg_match( $linktrail, $trail, $m2 ) ) { |
1018 | | - $dtrail = $m2[1]; |
1019 | | - $trail = $m2[2]; |
1020 | | - } |
| 1025 | + list( $dtrail, $trail ) = Linker::splitTrail( $trail ); |
1021 | 1026 | } |
1022 | 1027 | |
1023 | 1028 | $text = $wgContLang->markNoConversion($text); |
1024 | 1029 | |
1025 | 1030 | # Replace & from obsolete syntax with &. |
1026 | 1031 | # All HTML entities will be escaped by makeExternalLink() |
1027 | | - # or maybeMakeImageLink() |
| 1032 | + # or maybeMakeExternalImage() |
1028 | 1033 | $url = str_replace( '&', '&', $url ); |
1029 | 1034 | |
1030 | 1035 | # Process the trail (i.e. everything after this link up until start of the next link), |
— | — | @@ -1089,11 +1094,11 @@ |
1090 | 1095 | |
1091 | 1096 | # Replace & from obsolete syntax with &. |
1092 | 1097 | # All HTML entities will be escaped by makeExternalLink() |
1093 | | - # or maybeMakeImageLink() |
| 1098 | + # or maybeMakeExternalImage() |
1094 | 1099 | $url = str_replace( '&', '&', $url ); |
1095 | 1100 | |
1096 | 1101 | # Is this an external image? |
1097 | | - $text = $this->maybeMakeImageLink( $url ); |
| 1102 | + $text = $this->maybeMakeExternalImage( $url ); |
1098 | 1103 | if ( $text === false ) { |
1099 | 1104 | # Not an image, make a link |
1100 | 1105 | $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free' ); |
— | — | @@ -1111,13 +1116,13 @@ |
1112 | 1117 | * make an image if it's allowed |
1113 | 1118 | * @access private |
1114 | 1119 | */ |
1115 | | - function maybeMakeImageLink( $url ) { |
| 1120 | + function maybeMakeExternalImage( $url ) { |
1116 | 1121 | $sk =& $this->mOptions->getSkin(); |
1117 | 1122 | $text = false; |
1118 | 1123 | if ( $this->mOptions->getAllowExternalImages() ) { |
1119 | 1124 | if ( preg_match( EXT_IMAGE_REGEX, $url ) ) { |
1120 | 1125 | # Image found |
1121 | | - $text = $sk->makeImage( htmlspecialchars( $url ) ); |
| 1126 | + $text = $sk->makeExternalImage( htmlspecialchars( $url ) ); |
1122 | 1127 | } |
1123 | 1128 | } |
1124 | 1129 | return $text; |
— | — | @@ -1140,10 +1145,6 @@ |
1141 | 1146 | if ( !$tc ) { $tc = Title::legalChars() . '#%'; } |
1142 | 1147 | |
1143 | 1148 | $sk =& $this->mOptions->getSkin(); |
1144 | | - global $wgUseOldExistenceCheck; |
1145 | | - # "Post-parse link colour check" works only on wiki text since it's now |
1146 | | - # in Parser. Enable it, then disable it when we're done. |
1147 | | - $saveParseColour = $sk->postParseLinkColour( !$wgUseOldExistenceCheck ); |
1148 | 1149 | |
1149 | 1150 | #split the entire text string on occurences of [[ |
1150 | 1151 | $a = explode( '[[', ' ' . $s ); |
— | — | @@ -1327,7 +1328,7 @@ |
1328 | 1329 | $text = $this->replaceInternalLinks($text); |
1329 | 1330 | |
1330 | 1331 | # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them |
1331 | | - $s .= $prefix . str_replace('http://', 'http-noparse://', $sk->makeImageLinkObj( $nt, $text ) ) . $trail; |
| 1332 | + $s .= $prefix . str_replace('http://', 'http-noparse://', $this->makeImage( $nt, $text ) ) . $trail; |
1332 | 1333 | $wgLinkCache->addImageLinkObj( $nt ); |
1333 | 1334 | |
1334 | 1335 | wfProfileOut( "$fname-image" ); |
— | — | @@ -1343,10 +1344,7 @@ |
1344 | 1345 | $s = rtrim($s . "\n"); # bug 87 |
1345 | 1346 | |
1346 | 1347 | $wgLinkCache->suspend(); # Don't save in links/brokenlinks |
1347 | | - $pPLC=$sk->postParseLinkColour(); |
1348 | | - $sk->postParseLinkColour( false ); |
1349 | 1348 | $t = $sk->makeLinkObj( $nt, $t, '', '' , $prefix ); |
1350 | | - $sk->postParseLinkColour( $pPLC ); |
1351 | 1349 | $wgLinkCache->resume(); |
1352 | 1350 | |
1353 | 1351 | if ( $wasblank ) { |
— | — | @@ -1388,14 +1386,54 @@ |
1389 | 1387 | $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail ); |
1390 | 1388 | continue; |
1391 | 1389 | } |
1392 | | - $s .= $sk->makeLinkObj( $nt, $text, '', $trail, $prefix ); |
| 1390 | + if ( $nt->isAlwaysKnown() ) { |
| 1391 | + $s .= $sk->makeKnownLinkObj( $nt, $text, '', $trail, $prefix ); |
| 1392 | + } else { |
| 1393 | + /** |
| 1394 | + * Add a link placeholder |
| 1395 | + * Later, this will be replaced by a real link, after the existence or |
| 1396 | + * non-existence of all the links is known |
| 1397 | + */ |
| 1398 | + $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix ); |
| 1399 | + } |
1393 | 1400 | } |
1394 | | - $sk->postParseLinkColour( $saveParseColour ); |
1395 | 1401 | wfProfileOut( $fname ); |
1396 | 1402 | return $s; |
1397 | 1403 | } |
1398 | 1404 | |
1399 | 1405 | /** |
| 1406 | + * Make a link placeholder. The text returned can be later resolved to a real link with |
| 1407 | + * replaceLinkHolders(). This is done for two reasons: firstly to avoid further |
| 1408 | + * parsing of interwiki links, and secondly to allow all extistence checks and |
| 1409 | + * article length checks (for stub links) to be bundled into a single query. |
| 1410 | + * |
| 1411 | + */ |
| 1412 | + function makeLinkHolder( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 1413 | + if ( ! is_object($nt) ) { |
| 1414 | + # Fail gracefully |
| 1415 | + $retVal = "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
| 1416 | + } else { |
| 1417 | + # Separate the link trail from the rest of the link |
| 1418 | + list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 1419 | + |
| 1420 | + if ( $nt->isExternal() ) { |
| 1421 | + $iwRecord = array( $nt->getPrefixedDBkey(), $prefix.$text.$inside ); |
| 1422 | + $nr = array_push($this->mInterwikiLinkHolders, $iwRecord); |
| 1423 | + $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}"; |
| 1424 | + } else { |
| 1425 | + $nr = array_push( $this->mLinkHolders['namespaces'], $nt->getNamespace() ); |
| 1426 | + $this->mLinkHolders['dbkeys'][] = $nt->getDBkey(); |
| 1427 | + $this->mLinkHolders['queries'][] = $query; |
| 1428 | + $this->mLinkHolders['texts'][] = $prefix.$text.$inside; |
| 1429 | + $this->mLinkHolders['titles'][] =& $nt; |
| 1430 | + |
| 1431 | + $retVal = '<!--LINK '. ($nr-1) ."-->{$trail}"; |
| 1432 | + } |
| 1433 | + } |
| 1434 | + return $retVal; |
| 1435 | + } |
| 1436 | + |
| 1437 | + /** |
1400 | 1438 | * Return true if subpage links should be expanded on this page. |
1401 | 1439 | * @return bool |
1402 | 1440 | */ |
— | — | @@ -2409,10 +2447,10 @@ |
2410 | 2448 | # turns into |
2411 | 2449 | # link text with suffix |
2412 | 2450 | $canonized_headline = preg_replace( '/<!--LINK ([0-9]*)-->/e', |
2413 | | - "\$wgLinkHolders['texts'][\$1]", |
| 2451 | + "\$this->mLinkHolders['texts'][\$1]", |
2414 | 2452 | $canonized_headline ); |
2415 | 2453 | $canonized_headline = preg_replace( '/<!--IWLINK ([0-9]*)-->/e', |
2416 | | - "\$wgInterwikiLinkHolders[\$1]", |
| 2454 | + "\$this->mInterwikiLinkHolders[\$1][1]", |
2417 | 2455 | $canonized_headline ); |
2418 | 2456 | |
2419 | 2457 | # strip out HTML |
— | — | @@ -2791,36 +2829,30 @@ |
2792 | 2830 | * $options is a bit field, RLH_FOR_UPDATE to select for update |
2793 | 2831 | */ |
2794 | 2832 | function replaceLinkHolders( &$text, $options = 0 ) { |
2795 | | - global $wgUser, $wgLinkCache, $wgUseOldExistenceCheck, $wgLinkHolders; |
2796 | | - global $wgInterwikiLinkHolders; |
2797 | | - global $outputReplace; |
2798 | | - |
2799 | | - if ( $wgUseOldExistenceCheck ) { |
2800 | | - return array(); |
2801 | | - } |
| 2833 | + global $wgUser, $wgLinkCache; |
| 2834 | + global $wgOutputReplace; |
2802 | 2835 | |
2803 | 2836 | $fname = 'Parser::replaceLinkHolders'; |
2804 | 2837 | wfProfileIn( $fname ); |
2805 | 2838 | |
2806 | 2839 | $pdbks = array(); |
2807 | 2840 | $colours = array(); |
| 2841 | + $sk = $this->mOptions->getSkin(); |
2808 | 2842 | |
2809 | | - #if ( !empty( $tmpLinks[0] ) ) { #TODO |
2810 | | - if ( !empty( $wgLinkHolders['namespaces'] ) ) { |
| 2843 | + if ( !empty( $this->mLinkHolders['namespaces'] ) ) { |
2811 | 2844 | wfProfileIn( $fname.'-check' ); |
2812 | 2845 | $dbr =& wfGetDB( DB_SLAVE ); |
2813 | 2846 | $page = $dbr->tableName( 'page' ); |
2814 | | - $sk = $wgUser->getSkin(); |
2815 | 2847 | $threshold = $wgUser->getOption('stubthreshold'); |
2816 | 2848 | |
2817 | 2849 | # Sort by namespace |
2818 | | - asort( $wgLinkHolders['namespaces'] ); |
| 2850 | + asort( $this->mLinkHolders['namespaces'] ); |
2819 | 2851 | |
2820 | 2852 | # Generate query |
2821 | 2853 | $query = false; |
2822 | | - foreach ( $wgLinkHolders['namespaces'] as $key => $val ) { |
| 2854 | + foreach ( $this->mLinkHolders['namespaces'] as $key => $val ) { |
2823 | 2855 | # Make title object |
2824 | | - $title = $wgLinkHolders['titles'][$key]; |
| 2856 | + $title = $this->mLinkHolders['titles'][$key]; |
2825 | 2857 | |
2826 | 2858 | # Skip invalid entries. |
2827 | 2859 | # Result will be ugly, but prevents crash. |
— | — | @@ -2850,7 +2882,7 @@ |
2851 | 2883 | $query .= ', '; |
2852 | 2884 | } |
2853 | 2885 | |
2854 | | - $query .= $dbr->addQuotes( $wgLinkHolders['dbkeys'][$key] ); |
| 2886 | + $query .= $dbr->addQuotes( $this->mLinkHolders['dbkeys'][$key] ); |
2855 | 2887 | } |
2856 | 2888 | } |
2857 | 2889 | if ( $query ) { |
— | — | @@ -2886,25 +2918,25 @@ |
2887 | 2919 | |
2888 | 2920 | # Construct search and replace arrays |
2889 | 2921 | wfProfileIn( $fname.'-construct' ); |
2890 | | - $outputReplace = array(); |
2891 | | - foreach ( $wgLinkHolders['namespaces'] as $key => $ns ) { |
| 2922 | + $wgOutputReplace = array(); |
| 2923 | + foreach ( $this->mLinkHolders['namespaces'] as $key => $ns ) { |
2892 | 2924 | $pdbk = $pdbks[$key]; |
2893 | | - $searchkey = '<!--LINK '.$key.'-->'; |
2894 | | - $title = $wgLinkHolders['titles'][$key]; |
| 2925 | + $searchkey = "<!--LINK $key-->"; |
| 2926 | + $title = $this->mLinkHolders['titles'][$key]; |
2895 | 2927 | if ( empty( $colours[$pdbk] ) ) { |
2896 | 2928 | $wgLinkCache->addBadLink( $pdbk ); |
2897 | 2929 | $colours[$pdbk] = 0; |
2898 | | - $outputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title, |
2899 | | - $wgLinkHolders['texts'][$key], |
2900 | | - $wgLinkHolders['queries'][$key] ); |
| 2930 | + $wgOutputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title, |
| 2931 | + $this->mLinkHolders['texts'][$key], |
| 2932 | + $this->mLinkHolders['queries'][$key] ); |
2901 | 2933 | } elseif ( $colours[$pdbk] == 1 ) { |
2902 | | - $outputReplace[$searchkey] = $sk->makeKnownLinkObj( $title, |
2903 | | - $wgLinkHolders['texts'][$key], |
2904 | | - $wgLinkHolders['queries'][$key] ); |
| 2934 | + $wgOutputReplace[$searchkey] = $sk->makeKnownLinkObj( $title, |
| 2935 | + $this->mLinkHolders['texts'][$key], |
| 2936 | + $this->mLinkHolders['queries'][$key] ); |
2905 | 2937 | } elseif ( $colours[$pdbk] == 2 ) { |
2906 | | - $outputReplace[$searchkey] = $sk->makeStubLinkObj( $title, |
2907 | | - $wgLinkHolders['texts'][$key], |
2908 | | - $wgLinkHolders['queries'][$key] ); |
| 2938 | + $wgOutputReplace[$searchkey] = $sk->makeStubLinkObj( $title, |
| 2939 | + $this->mLinkHolders['texts'][$key], |
| 2940 | + $this->mLinkHolders['queries'][$key] ); |
2909 | 2941 | } |
2910 | 2942 | } |
2911 | 2943 | wfProfileOut( $fname.'-construct' ); |
— | — | @@ -2914,32 +2946,30 @@ |
2915 | 2947 | |
2916 | 2948 | $text = preg_replace_callback( |
2917 | 2949 | '/(<!--LINK .*?-->)/', |
2918 | | - "outputReplaceMatches", |
| 2950 | + "wfOutputReplaceMatches", |
2919 | 2951 | $text); |
| 2952 | + |
2920 | 2953 | wfProfileOut( $fname.'-replace' ); |
2921 | 2954 | } |
2922 | 2955 | |
2923 | | - if ( !empty( $wgInterwikiLinkHolders ) ) { |
| 2956 | + # Now process interwiki link holders |
| 2957 | + # This is quite a bit simpler than internal links |
| 2958 | + if ( !empty( $this->mInterwikiLinkHolders ) ) { |
2924 | 2959 | wfProfileIn( $fname.'-interwiki' ); |
2925 | | - $outputReplace = $wgInterwikiLinkHolders; |
| 2960 | + # Make interwiki link HTML |
| 2961 | + $wgOutputReplace = array(); |
| 2962 | + foreach( $this->mInterwikiLinkHolders as $i => $lh ) { |
| 2963 | + $s = $sk->makeLink( $lh[0], $lh[1] ); |
| 2964 | + $wgOutputReplace[] = $s; |
| 2965 | + } |
| 2966 | + |
2926 | 2967 | $text = preg_replace_callback( |
2927 | 2968 | '/<!--IWLINK (.*?)-->/', |
2928 | | - "outputReplaceMatches", |
| 2969 | + "wfOutputReplaceMatches", |
2929 | 2970 | $text ); |
2930 | 2971 | wfProfileOut( $fname.'-interwiki' ); |
2931 | 2972 | } |
2932 | 2973 | |
2933 | | - # Clear link holders, no need to fetch these ones again in a subsequent invocation |
2934 | | - $wgLinkHolders = array( |
2935 | | - 'namespaces' => array(), |
2936 | | - 'dbkeys' => array(), |
2937 | | - 'queries' => array(), |
2938 | | - 'texts' => array(), |
2939 | | - 'titles' => array() |
2940 | | - ); |
2941 | | - $wgInterwikiLinkHolders = array(); |
2942 | | - |
2943 | | - |
2944 | 2974 | wfProfileOut( $fname ); |
2945 | 2975 | return $colours; |
2946 | 2976 | } |
— | — | @@ -2952,6 +2982,8 @@ |
2953 | 2983 | * given as text will return the HTML of a gallery with two images, |
2954 | 2984 | * labeled 'The number "1"' and |
2955 | 2985 | * 'A tree'. |
| 2986 | + * |
| 2987 | + * @static |
2956 | 2988 | */ |
2957 | 2989 | function renderImageGallery( $text ) { |
2958 | 2990 | # Setup the parser |
— | — | @@ -2991,6 +3023,84 @@ |
2992 | 3024 | } |
2993 | 3025 | return $ig->toHTML(); |
2994 | 3026 | } |
| 3027 | + |
| 3028 | + /** |
| 3029 | + * Parse image options text and use it to make an image |
| 3030 | + */ |
| 3031 | + function makeImage( &$nt, $options ) { |
| 3032 | + global $wgContLang, $wgUseImageResize; |
| 3033 | + global $wgUser, $wgThumbLimits; |
| 3034 | + |
| 3035 | + $align = ''; |
| 3036 | + |
| 3037 | + # Check if the options text is of the form "options|alt text" |
| 3038 | + # Options are: |
| 3039 | + # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
| 3040 | + # * left no resizing, just left align. label is used for alt= only |
| 3041 | + # * right same, but right aligned |
| 3042 | + # * none same, but not aligned |
| 3043 | + # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
| 3044 | + # * center center the image |
| 3045 | + # * framed Keep original image size, no magnify-button. |
| 3046 | + |
| 3047 | + $part = explode( '|', $options); |
| 3048 | + |
| 3049 | + $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL ); |
| 3050 | + $mwLeft =& MagicWord::get( MAG_IMG_LEFT ); |
| 3051 | + $mwRight =& MagicWord::get( MAG_IMG_RIGHT ); |
| 3052 | + $mwNone =& MagicWord::get( MAG_IMG_NONE ); |
| 3053 | + $mwWidth =& MagicWord::get( MAG_IMG_WIDTH ); |
| 3054 | + $mwCenter =& MagicWord::get( MAG_IMG_CENTER ); |
| 3055 | + $mwFramed =& MagicWord::get( MAG_IMG_FRAMED ); |
| 3056 | + $caption = ''; |
| 3057 | + |
| 3058 | + $width = $height = $framed = $thumb = false; |
| 3059 | + $manual_thumb = "" ; |
| 3060 | + |
| 3061 | + foreach( $part as $key => $val ) { |
| 3062 | + $val_parts = explode ( "=" , $val , 2 ) ; |
| 3063 | + $left_part = array_shift ( $val_parts ) ; |
| 3064 | + if ( $wgUseImageResize && ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) { |
| 3065 | + $thumb=true; |
| 3066 | + } elseif ( $wgUseImageResize && count ( $val_parts ) == 1 && ! is_null( $mwThumb->matchVariableStartToEnd($left_part) ) ) { |
| 3067 | + # use manually specified thumbnail |
| 3068 | + $thumb=true; |
| 3069 | + $manual_thumb = array_shift ( $val_parts ) ; |
| 3070 | + } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) { |
| 3071 | + # remember to set an alignment, don't render immediately |
| 3072 | + $align = 'right'; |
| 3073 | + } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) { |
| 3074 | + # remember to set an alignment, don't render immediately |
| 3075 | + $align = 'left'; |
| 3076 | + } elseif ( ! is_null( $mwCenter->matchVariableStartToEnd($val) ) ) { |
| 3077 | + # remember to set an alignment, don't render immediately |
| 3078 | + $align = 'center'; |
| 3079 | + } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) { |
| 3080 | + # remember to set an alignment, don't render immediately |
| 3081 | + $align = 'none'; |
| 3082 | + } elseif ( $wgUseImageResize && ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) { |
| 3083 | + # $match is the image width in pixels |
| 3084 | + if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) { |
| 3085 | + $width = intval( $m[1] ); |
| 3086 | + $height = intval( $m[2] ); |
| 3087 | + } else { |
| 3088 | + $width = intval($match); |
| 3089 | + } |
| 3090 | + } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) { |
| 3091 | + $framed=true; |
| 3092 | + } else { |
| 3093 | + $caption = $val; |
| 3094 | + } |
| 3095 | + } |
| 3096 | + # Strip bad stuff out of the alt text |
| 3097 | + $alt = $caption; |
| 3098 | + $this->replaceLinkHolders( $alt ); |
| 3099 | + $alt = Sanitizer::stripAllTags( $alt ); |
| 3100 | + |
| 3101 | + # Linker does the rest |
| 3102 | + $sk =& $this->mOptions->getSkin(); |
| 3103 | + return $sk->makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb ); |
| 3104 | + } |
2995 | 3105 | } |
2996 | 3106 | |
2997 | 3107 | /** |
— | — | @@ -3131,9 +3241,9 @@ |
3132 | 3242 | * Callback function used by Parser::replaceLinkHolders() |
3133 | 3243 | * to substitute link placeholders. |
3134 | 3244 | */ |
3135 | | -function &outputReplaceMatches( $matches ) { |
3136 | | - global $outputReplace; |
3137 | | - return $outputReplace[$matches[1]]; |
| 3245 | +function &wfOutputReplaceMatches( $matches ) { |
| 3246 | + global $wgOutputReplace; |
| 3247 | + return $wgOutputReplace[$matches[1]]; |
3138 | 3248 | } |
3139 | 3249 | |
3140 | 3250 | /** |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1989,5 +1989,18 @@ |
1990 | 1990 | return $this->getArticleId() != 0; |
1991 | 1991 | } |
1992 | 1992 | |
| 1993 | + /** |
| 1994 | + * Should a link should be displayed as a known link, just based on its title? |
| 1995 | + * |
| 1996 | + * Currently, a self-link with a fragment, special pages and image pages are in |
| 1997 | + * this category. Special pages never exist in the database. Some images do not |
| 1998 | + * have description pages in the database, but the description page contains |
| 1999 | + * useful history information that the user may want to link to. |
| 2000 | + * |
| 2001 | + */ |
| 2002 | + function isAlwaysKnown() { |
| 2003 | + return ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) |
| 2004 | + || NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace; |
| 2005 | + } |
1993 | 2006 | } |
1994 | 2007 | ?> |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -34,17 +34,6 @@ |
35 | 35 | |
36 | 36 | require_once( 'RecentChange.php' ); |
37 | 37 | |
38 | | -global $wgLinkHolders; |
39 | | -$wgLinkHolders = array( |
40 | | - 'namespaces' => array(), |
41 | | - 'dbkeys' => array(), |
42 | | - 'queries' => array(), |
43 | | - 'texts' => array(), |
44 | | - 'titles' => array() |
45 | | -); |
46 | | -global $wgInterwikiLinkHolders; |
47 | | -$wgInterwikiLinkHolders = array(); |
48 | | - |
49 | 38 | /** |
50 | 39 | * @todo document |
51 | 40 | * @package MediaWiki |