r9860 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9859‎ | r9860 | r9861 >
Date:07:15, 3 July 2005
Author:kateturner
Status:old
Tags:
Comment:
- proxy support for wfGetHTTP()
- support for interwiki transcludes (disabled by default, keyed on iw_trans)
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-interwiki-trans.sql (added) (history)
  • /trunk/phase3/maintenance/archives/patch-transcache.sql (added) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-interwiki-trans.sql
@@ -0,0 +1,2 @@
 2+ALTER TABLE /*$wgDBprefix*/interwiki
 3+ ADD COLUMN iw_trans TINYINT(1) NOT NULL DEFAULT 0;
Property changes on: trunk/phase3/maintenance/archives/patch-interwiki-trans.sql
___________________________________________________________________
Added: svn:eol-style
14 + native
Added: svn:keywords
25 + Author Date Id Revision
Index: trunk/phase3/maintenance/archives/patch-transcache.sql
@@ -0,0 +1,7 @@
 2+CREATE TABLE /*$wgDBprefix*/transcache (
 3+ tc_url TEXT NOT NULL,
 4+ tc_contents TEXT,
 5+ tc_time INT NOT NULL,
 6+ UNIQUE INDEX tc_url_idx(tc_url(512))
 7+);
 8+
Property changes on: trunk/phase3/maintenance/archives/patch-transcache.sql
___________________________________________________________________
Added: svn:eol-style
19 + native
Added: svn:keywords
210 + Author Date Id Revision
Index: trunk/phase3/maintenance/updaters.inc
@@ -24,6 +24,7 @@
2525 array( 'logging', 'patch-logging.sql' ),
2626 array( 'validate', 'patch-validate.sql' ),
2727 array( 'user_newtalk', 'patch-usernewtalk2.sql' ),
 28+ array( 'transcache', 'patch-transcache.sql' ),
2829 );
2930
3031 $wgNewFields = array(
@@ -47,6 +48,7 @@
4849 array( 'image', 'img_media_type', 'patch-img_media_type.sql' ),
4950 array( 'validate', 'val_ip', 'patch-val_ip.sql' ),
5051 array( 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
 52+ array( 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
5153 );
5254
5355 function rename_table( $from, $to, $patch ) {
Index: trunk/phase3/includes/Parser.php
@@ -8,6 +8,7 @@
99
1010 /** */
1111 require_once( 'Sanitizer.php' );
 12+require_once( 'HttpFunctions.php' );
1213
1314 /**
1415 * Update this version number when the ParserOutput format
@@ -63,7 +64,7 @@
6465
6566 /**
6667 * PHP Parser
67 - *
 68+ *
6869 * Processes wiki markup
6970 *
7071 * <pre>
@@ -110,11 +111,13 @@
111112 $mTemplatePath; // stores an unsorted hash of all the templates already loaded
112113 // in this path. Used for loop detection.
113114
 115+ var $mIWTransData = array();
 116+
114117 /**#@-*/
115118
116119 /**
117120 * Constructor
118 - *
 121+ *
119122 * @access public
120123 */
121124 function Parser() {
@@ -179,11 +182,11 @@
180183 $this->mOutputType = OT_HTML;
181184
182185 $this->mStripState = NULL;
183 -
 186+
184187 //$text = $this->strip( $text, $this->mStripState );
185188 // VOODOO MAGIC FIX! Sometimes the above segfaults in PHP5.
186189 $x =& $this->mStripState;
187 -
 190+
188191 wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$x ) );
189192 $text = $this->strip( $text, $x );
190193 wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$x ) );
@@ -191,7 +194,7 @@
192195 $text = $this->internalParse( $text );
193196
194197 $text = $this->unstrip( $text, $this->mStripState );
195 -
 198+
196199 # Clean up special characters, only run once, next-to-last before doBlockLevels
197200 $fixtags = array(
198201 # french spaces, last one Guillemet-left
@@ -203,14 +206,14 @@
204207 '/<\\/center *>/i' => '</div>',
205208 );
206209 $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text );
207 -
 210+
208211 # only once and last
209212 $text = $this->doBlockLevels( $text, $linestart );
210213
211214 $this->replaceLinkHolders( $text );
212215
213 - # the position of the convert() call should not be changed. it
214 - # assumes that the links are all replaces and the only thing left
 216+ # the position of the convert() call should not be changed. it
 217+ # assumes that the links are all replaces and the only thing left
215218 # is the <nowiki> mark.
216219 $text = $wgContLang->convert($text);
217220 $this->mOutput->setTitleText($wgContLang->getParsedTitle());
@@ -218,7 +221,7 @@
219222 $text = $this->unstripNoWiki( $text, $this->mStripState );
220223
221224 wfRunHooks( 'ParserBeforeTidy', array( &$this, &$text ) );
222 -
 225+
223226 $text = Sanitizer::normalizeCharReferences( $text );
224227 global $wgUseTidy;
225228 if ($wgUseTidy) {
@@ -242,12 +245,12 @@
243246 return dechex(mt_rand(0, 0x7fffffff)) . dechex(mt_rand(0, 0x7fffffff));
244247 }
245248
246 - /**
 249+ /**
247250 * Replaces all occurrences of <$tag>content</$tag> in the text
248251 * with a random marker and returns the new text. the output parameter
249252 * $content will be an associative array filled with data on the form
250253 * $unique_marker => content.
251 - *
 254+ *
252255 * If $content is already set, the additional entries will be appended
253256 * If $tag is set to STRIP_COMMENTS, the function will extract
254257 * <!-- HTML comments -->
@@ -262,11 +265,11 @@
263266 }
264267 $n = 1;
265268 $stripped = '';
266 -
 269+
267270 if ( !$tags ) {
268271 $tags = array( );
269272 }
270 -
 273+
271274 if ( !$params ) {
272275 $params = array( );
273276 }
@@ -287,13 +290,13 @@
288291 }
289292 $attributes = $p[1];
290293 $inside = $p[2];
291 -
 294+
292295 $marker = $rnd . sprintf('%08X', $n++);
293296 $stripped .= $marker;
294 -
 297+
295298 $tags[$marker] = "<$tag$attributes>";
296299 $params[$marker] = Sanitizer::decodeTagAttributes( $attributes );
297 -
 300+
298301 $q = preg_split( $end, $inside, 2 );
299302 $content[$marker] = $q[0];
300303 if( count( $q ) < 1 ) {
@@ -317,11 +320,11 @@
318321 function extractTags( $tag, $text, &$content, $uniq_prefix = '' ) {
319322 $dummy_tags = array();
320323 $dummy_params = array();
321 -
 324+
322325 return Parser::extractTagsAndParams( $tag, $text, $content,
323326 $dummy_tags, $dummy_params, $uniq_prefix );
324327 }
325 -
 328+
326329 /**
327330 * Strips and renders nowiki, pre, math, hiero
328331 * If $render is set, performs necessary rendering operations on plugins
@@ -555,7 +558,7 @@
556559 }
557560 return $correctedtext;
558561 }
559 -
 562+
560563 /**
561564 * Spawn an external HTML tidy process and get corrected markup back from it.
562565 *
@@ -612,7 +615,7 @@
613616 global $wgTidyConf;
614617 $fname = 'Parser::internalTidy';
615618 wfProfileIn( $fname );
616 -
 619+
617620 tidy_load_config( $wgTidyConf );
618621 tidy_set_encoding( 'utf8' );
619622 tidy_parse_string( $text );
@@ -764,20 +767,28 @@
765768 }
766769 $text = $this->doAllQuotes( $text );
767770 $text = $this->replaceInternalLinks( $text );
768 - $text = $this->replaceExternalLinks( $text );
769 -
 771+ $text = $this->replaceExternalLinks( $text );
 772+
770773 # replaceInternalLinks may sometimes leave behind
771774 # absolute URLs, which have to be masked to hide them from replaceExternalLinks
772775 $text = str_replace("http-noparse://","http://",$text);
773 -
 776+
774777 $text = $this->doMagicLinks( $text );
775778 $text = $this->doTableStuff( $text );
776779 $text = $this->formatHeadings( $text, $isMain );
777780
 781+ $regex = '/<!--IW_TRANSCLUDE (\d+)-->/';
 782+ $text = preg_replace_callback($regex, array(&$this, 'scarySubstitution'), $text);
 783+
778784 wfProfileOut( $fname );
779785 return $text;
780786 }
781787
 788+ function scarySubstitution($matches) {
 789+# return "[[".$matches[0]."]]";
 790+ return $this->mIWTransData[(int)$matches[0]];
 791+ }
 792+
782793 /**
783794 * Replace special strings like "ISBN xxx" and "RFC xxx" with
784795 * magic external links.
@@ -1018,7 +1029,7 @@
10191030 wfProfileIn( $fname );
10201031
10211032 $sk =& $this->mOptions->getSkin();
1022 -
 1033+
10231034 $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
10241035
10251036 $s = $this->replaceFreeExternalLinks( array_shift( $bits ) );
@@ -1098,7 +1109,7 @@
10991110 global $wgContLang;
11001111 $fname = 'Parser::replaceFreeExternalLinks';
11011112 wfProfileIn( $fname );
1102 -
 1113+
11031114 $bits = preg_split( '/(\b(?:'.URL_PROTOCOLS.'):)/S', $text, -1, PREG_SPLIT_DELIM_CAPTURE );
11041115 $s = array_shift( $bits );
11051116 $i = 0;
@@ -1170,7 +1181,7 @@
11711182 }
11721183 return $text;
11731184 }
1174 -
 1185+
11751186 /**
11761187 * Process [[ ]] wikilinks
11771188 *
@@ -1186,7 +1197,7 @@
11871198 static $tc = FALSE;
11881199 # the % is needed to support urlencoded titles as well
11891200 if ( !$tc ) { $tc = Title::legalChars() . '#%'; }
1190 -
 1201+
11911202 $sk =& $this->mOptions->getSkin();
11921203
11931204 #split the entire text string on occurences of [[
@@ -1228,7 +1239,7 @@
12291240
12301241 $checkVariantLink = sizeof($wgContLang->getVariants())>1;
12311242 $useSubpages = $this->areSubpagesAllowed();
1232 -
 1243+
12331244 # Loop for each link
12341245 for ($k = 0; isset( $a[$k] ); $k++) {
12351246 $line = $a[$k];
@@ -1249,7 +1260,7 @@
12501261 }
12511262
12521263 $might_be_img = false;
1253 -
 1264+
12541265 if ( preg_match( $e1, $line, $m ) ) { # page with normal text or alt
12551266 $text = $m[2];
12561267 # If we get a ] at the beginning of $m[3] that means we have a link that's something like:
@@ -1297,7 +1308,7 @@
12981309 # Strip off leading ':'
12991310 $link = substr($link, 1);
13001311 }
1301 -
 1312+
13021313 $nt =& Title::newFromText( $this->unstripNoWiki($link, $this->mStripState) );
13031314 if( !$nt ) {
13041315 $s .= $prefix . '[[' . $line;
@@ -1313,7 +1324,7 @@
13141325
13151326 $ns = $nt->getNamespace();
13161327 $iw = $nt->getInterWiki();
1317 -
 1328+
13181329 if ($might_be_img) { # if this is actually an invalid link
13191330 if ($ns == NS_IMAGE && $noforce) { #but might be an image
13201331 $found = false;
@@ -1353,7 +1364,7 @@
13541365 $wasblank = ( '' == $text );
13551366 if( $wasblank ) $text = $link;
13561367
1357 -
 1368+
13581369 # Link not escaped by : , create the various objects
13591370 if( $noforce ) {
13601371
@@ -1364,7 +1375,7 @@
13651376 $s .= trim($prefix . $trail, "\n") == '' ? '': $prefix . $trail;
13661377 continue;
13671378 }
1368 -
 1379+
13691380 if ( $ns == NS_IMAGE ) {
13701381 wfProfileIn( "$fname-image" );
13711382 if ( !wfIsBadImage( $nt->getDBkey() ) ) {
@@ -1373,18 +1384,18 @@
13741385 # but it might be hard to fix that, and it doesn't matter ATM
13751386 $text = $this->replaceExternalLinks($text);
13761387 $text = $this->replaceInternalLinks($text);
1377 -
 1388+
13781389 # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them
13791390 $s .= $prefix . str_replace('http://', 'http-noparse://', $this->makeImage( $nt, $text ) ) . $trail;
13801391 $wgLinkCache->addImageLinkObj( $nt );
1381 -
 1392+
13821393 wfProfileOut( "$fname-image" );
13831394 continue;
13841395 }
13851396 wfProfileOut( "$fname-image" );
13861397
13871398 }
1388 -
 1399+
13891400 if ( $ns == NS_CATEGORY ) {
13901401 wfProfileIn( "$fname-category" );
13911402 $t = $wgContLang->convertHtml( $nt->getText() );
@@ -1406,13 +1417,13 @@
14071418 $sortkey = $wgContLang->convertCategoryKey( $sortkey );
14081419 $wgLinkCache->addCategoryLinkObj( $nt, $sortkey );
14091420 $this->mOutput->addCategoryLink( $t );
1410 -
 1421+
14111422 /**
14121423 * Strip the whitespace Category links produce, see bug 87
14131424 * @todo We might want to use trim($tmp, "\n") here.
14141425 */
14151426 $s .= trim($prefix . $trail, "\n") == '' ? '': $prefix . $trail;
1416 -
 1427+
14171428 wfProfileOut( "$fname-category" );
14181429 continue;
14191430 }
@@ -1445,7 +1456,7 @@
14461457 } else {
14471458 /**
14481459 * Add a link placeholder
1449 - * Later, this will be replaced by a real link, after the existence or
 1460+ * Later, this will be replaced by a real link, after the existence or
14501461 * non-existence of all the links is known
14511462 */
14521463 $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix );
@@ -1457,8 +1468,8 @@
14581469
14591470 /**
14601471 * Make a link placeholder. The text returned can be later resolved to a real link with
1461 - * replaceLinkHolders(). This is done for two reasons: firstly to avoid further
1462 - * parsing of interwiki links, and secondly to allow all extistence checks and
 1472+ * replaceLinkHolders(). This is done for two reasons: firstly to avoid further
 1473+ * parsing of interwiki links, and secondly to allow all extistence checks and
14631474 * article length checks (for stub links) to be bundled into a single query.
14641475 *
14651476 */
@@ -1469,7 +1480,7 @@
14701481 } else {
14711482 # Separate the link trail from the rest of the link
14721483 list( $inside, $trail ) = Linker::splitTrail( $trail );
1473 -
 1484+
14741485 if ( $nt->isExternal() ) {
14751486 $nr = array_push( $this->mInterwikiLinkHolders['texts'], $prefix.$text.$inside );
14761487 $this->mInterwikiLinkHolders['titles'][] = $nt;
@@ -1496,7 +1507,7 @@
14971508 global $wgNamespacesWithSubpages;
14981509 return !empty($wgNamespacesWithSubpages[$this->mTitle->getNamespace()]);
14991510 }
1500 -
 1511+
15011512 /**
15021513 * Handle link to subpage if necessary
15031514 * @param string $target the source of the link
@@ -1516,10 +1527,10 @@
15171528 $fname = 'Parser::maybeDoSubpageLink';
15181529 wfProfileIn( $fname );
15191530 $ret = $target; # default return value is no change
1520 -
1521 - # Some namespaces don't allow subpages,
 1531+
 1532+ # Some namespaces don't allow subpages,
15221533 # so only perform processing if subpages are allowed
1523 - if( $this->areSubpagesAllowed() ) {
 1534+ if( $this->areSubpagesAllowed() ) {
15241535 # Look at the first character
15251536 if( $target != '' && $target{0} == '/' ) {
15261537 # / at end means we don't want the slash to be shown
@@ -1529,7 +1540,7 @@
15301541 } else {
15311542 $noslash = substr( $target, 1 );
15321543 }
1533 -
 1544+
15341545 $ret = $this->mTitle->getPrefixedText(). '/' . trim($noslash);
15351546 if( '' === $text ) {
15361547 $text = $target;
@@ -1853,14 +1864,14 @@
18541865 */
18551866 function getVariableValue( $index ) {
18561867 global $wgContLang, $wgSitename, $wgServer, $wgServerName, $wgArticle, $wgScriptPath;
1857 -
 1868+
18581869 /**
18591870 * Some of these require message or data lookups and can be
18601871 * expensive to check many times.
18611872 */
18621873 static $varCache = array();
18631874 if( isset( $varCache[$index] ) ) return $varCache[$index];
1864 -
 1875+
18651876 switch ( $index ) {
18661877 case MAG_CURRENTMONTH:
18671878 return $varCache[$index] = $wgContLang->formatNum( date( 'm' ) );
@@ -1934,7 +1945,7 @@
19351946 * OT_WIKI: only {{subst:}} templates
19361947 * OT_MSG: only magic variables
19371948 * OT_HTML: all templates and magic variables
1938 - *
 1949+ *
19391950 * @param string $tex The text to transform
19401951 * @param array $args Key-value pairs representing template parameters to substitute
19411952 * @access private
@@ -1956,7 +1967,7 @@
19571968
19581969 # Variable substitution
19591970 $text = preg_replace_callback( "/{{([$titleChars]*?)}}/", array( &$this, 'variableSubstitution' ), $text );
1960 -
 1971+
19611972 if ( $this->mOutputType == OT_HTML || $this->mOutputType == OT_WIKI ) {
19621973 # Argument substitution
19631974 $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", array( &$this, 'argSubstitution' ), $text );
@@ -2015,7 +2026,7 @@
20162027 # merged with the next arg because the '|' character between belongs
20172028 # to the link syntax and not the template parameter syntax.
20182029 $argc = count($args);
2019 -
 2030+
20202031 for ( $i = 0; $i < $argc-1; $i++ ) {
20212032 if ( substr_count ( $args[$i], '[[' ) != substr_count ( $args[$i], ']]' ) ) {
20222033 $args[$i] .= '|'.$args[$i+1];
@@ -2042,7 +2053,7 @@
20432054 global $wgLinkCache, $wgContLang;
20442055 $fname = 'Parser::braceSubstitution';
20452056 wfProfileIn( $fname );
2046 -
 2057+
20472058 $found = false;
20482059 $nowiki = false;
20492060 $noparse = false;
@@ -2191,6 +2202,12 @@
21922203 $ns = $this->mTitle->getNamespace();
21932204 }
21942205 $title = Title::newFromText( $part1, $ns );
 2206+
 2207+ $interwiki = Title::getInterwikiLink($title->getInterwiki());
 2208+ if ($interwiki != '' && $title->isTrans()) {
 2209+ return $this->scarytransclude($title, $interwiki);
 2210+ }
 2211+
21952212 if ( !is_null( $title ) && !$title->isExternal() ) {
21962213 # Check for excessive inclusion
21972214 $dbk = $title->getPrefixedDBkey();
@@ -2275,14 +2292,14 @@
22762293 }
22772294 # Prune lower levels off the recursion check path
22782295 $this->mTemplatePath = $lastPathLevel;
2279 -
 2296+
22802297 if ( !$found ) {
22812298 wfProfileOut( $fname );
22822299 return $matches[0];
22832300 } else {
22842301 if ( $isHTML ) {
22852302 # Replace raw HTML by a placeholder
2286 - # Add a blank line preceding, to prevent it from mucking up
 2303+ # Add a blank line preceding, to prevent it from mucking up
22872304 # immediately preceding headings
22882305 $text = "\n\n" . $this->insertStripItem( $text, $this->mStripState );
22892306 } else {
@@ -2308,16 +2325,16 @@
23092326 preg_match('/^(={1,6})(.*?)(={1,6})\s*?$/m', $hl, $m2);
23102327 $text .= $m2[1] . $m2[2] . "<!--MWTEMPLATESECTION="
23112328 . $encodedname . "&" . base64_encode("$nsec") . "-->" . $m2[3];
2312 -
 2329+
23132330 $nsec++;
23142331 }
23152332 }
23162333 }
23172334 }
2318 -
 2335+
23192336 # Prune lower levels off the recursion check path
23202337 $this->mTemplatePath = $lastPathLevel;
2321 -
 2338+
23222339 if ( !$found ) {
23232340 wfProfileOut( $fname );
23242341 return $matches[0];
@@ -2328,6 +2345,47 @@
23292346 }
23302347
23312348 /**
 2349+ * Translude an interwiki link.
 2350+ */
 2351+ function scarytransclude($title, $interwiki) {
 2352+ global $wgEnableScaryTranscluding;
 2353+
 2354+ if (!$wgEnableScaryTranscluding)
 2355+ return wfMsg('scarytranscludedisabled');
 2356+
 2357+ $articlename = "Template:" . $title->getDBkey();
 2358+ $url = str_replace('$1', urlencode($articlename), $interwiki);
 2359+ $text = $this->fetchScaryTemplateMaybeFromCache($url);
 2360+ $this->mIWTransData[] = $text;
 2361+ return "<!--IW_TRANSCLUDE ".(count($this->mIWTransData) - 1)."-->";
 2362+ }
 2363+
 2364+ function fetchScaryTemplateMaybeFromCache($url) {
 2365+ $dbr = wfGetDB(DB_SLAVE);
 2366+ $obj = $dbr->selectRow('transcache', array('tc_time', 'tc_contents'),
 2367+ array('tc_url' => $url));
 2368+ if ($obj) {
 2369+ $time = $obj->tc_time;
 2370+ $text = $obj->tc_contents;
 2371+ if ($time && $time < (time() + (60*60))) {
 2372+ return $text;
 2373+ }
 2374+ }
 2375+
 2376+ $text = wfGetHTTP($url . '?action=render');
 2377+ if (!$text)
 2378+ return wfMsg('scarytranscludefailed');
 2379+
 2380+ $dbw = wfGetDB(DB_MASTER);
 2381+ $dbw->replace('transcache', array(), array(
 2382+ 'tc_url' => $url,
 2383+ 'tc_time' => time(),
 2384+ 'tc_contents' => $text));
 2385+ return $text;
 2386+ }
 2387+
 2388+
 2389+ /**
23322390 * Triple brace replacement -- used for template arguments
23332391 * @access private
23342392 */
@@ -2364,10 +2422,10 @@
23652423 * 2) Add an [edit] link to sections for logged in users who have enabled the option
23662424 * 3) Add a Table of contents on the top for users who have enabled the option
23672425 * 4) Auto-anchor headings
2368 - *
 2426+ *
23692427 * It loops through all headlines, collects the necessary data, then splits up the
23702428 * string and re-inserts the newly formatted headlines.
2371 - *
 2429+ *
23722430 * @param string $text
23732431 * @param boolean $isMain
23742432 * @access private
@@ -2464,9 +2522,9 @@
24652523 $prevtoclevel = $toclevel;
24662524 }
24672525 $level = $matches[1][$headlineCount];
2468 -
 2526+
24692527 if( $doNumberHeadings || $doShowToc ) {
2470 -
 2528+
24712529 if ( $level > $prevlevel ) {
24722530 # Increase TOC level
24732531 $toclevel++;
@@ -2500,7 +2558,7 @@
25012559 # No change in level, end TOC line
25022560 $toc .= $sk->tocLineEnd();
25032561 }
2504 -
 2562+
25052563 $levelCount[$toclevel] = $level;
25062564
25072565 # count number of headlines for each level
@@ -2524,7 +2582,7 @@
25252583
25262584 # Remove link placeholders by the link text.
25272585 # <!--LINK number-->
2528 - # turns into
 2586+ # turns into
25292587 # link text with suffix
25302588 $canonized_headline = preg_replace( '/<!--LINK ([0-9]*)-->/e',
25312589 "\$this->mLinkHolders['texts'][\$1]",
@@ -2676,7 +2734,7 @@
26772735 * @return string
26782736 */
26792737 function magicRFC( $text, $keyword='RFC ', $urlmsg='rfcurl' ) {
2680 -
 2738+
26812739 $valid = '0123456789';
26822740 $internal = false;
26832741
@@ -2685,7 +2743,7 @@
26862744 return $text;
26872745 }
26882746 $text = substr( array_shift( $a ), 1);
2689 -
 2747+
26902748 /* Check if keyword is preceed by [[.
26912749 * This test is made here cause of the array_shift above
26922750 * that prevent the test to be done in the foreach.
@@ -2728,7 +2786,7 @@
27292787 $la = $sk->getExternalLinkAttributes( $url, $keyword.$id );
27302788 $text .= "<a href='{$url}'{$la}>{$keyword}{$id}</a>{$x}";
27312789 }
2732 -
 2790+
27332791 /* Check if the next RFC keyword is preceed by [[ */
27342792 $internal = ( substr($x,-2) == '[[' );
27352793 }
@@ -2861,7 +2919,7 @@
28622920
28632921 /**
28642922 * Transform a MediaWiki message by replacing magic variables.
2865 - *
 2923+ *
28662924 * @param string $text the text to transform
28672925 * @param ParserOptions $options options
28682926 * @return string the text with variables substituted
@@ -2918,16 +2976,16 @@
29192977 $pdbks = array();
29202978 $colours = array();
29212979 $sk = $this->mOptions->getSkin();
2922 -
 2980+
29232981 if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
29242982 wfProfileIn( $fname.'-check' );
29252983 $dbr =& wfGetDB( DB_SLAVE );
29262984 $page = $dbr->tableName( 'page' );
29272985 $threshold = $wgUser->getOption('stubthreshold');
2928 -
 2986+
29292987 # Sort by namespace
29302988 asort( $this->mLinkHolders['namespaces'] );
2931 -
 2989+
29322990 # Generate query
29332991 $query = false;
29342992 foreach ( $this->mLinkHolders['namespaces'] as $key => $val ) {
@@ -2961,7 +3019,7 @@
29623020 } else {
29633021 $query .= ', ';
29643022 }
2965 -
 3023+
29663024 $query .= $dbr->addQuotes( $this->mLinkHolders['dbkeys'][$key] );
29673025 }
29683026 }
@@ -2970,9 +3028,9 @@
29713029 if ( $options & RLH_FOR_UPDATE ) {
29723030 $query .= ' FOR UPDATE';
29733031 }
2974 -
 3032+
29753033 $res = $dbr->query( $query, $fname );
2976 -
 3034+
29773035 # Fetch data and form into an associative array
29783036 # non-existent = broken
29793037 # 1 = known
@@ -2981,7 +3039,7 @@
29823040 $title = Title::makeTitle( $s->page_namespace, $s->page_title );
29833041 $pdbk = $title->getPrefixedDBkey();
29843042 $wgLinkCache->addGoodLinkObj( $s->page_id, $title );
2985 -
 3043+
29863044 if ( $threshold > 0 ) {
29873045 $size = $s->page_len;
29883046 if ( $s->page_is_redirect || $s->page_namespace != 0 || $size >= $threshold ) {
@@ -2995,7 +3053,7 @@
29963054 }
29973055 }
29983056 wfProfileOut( $fname.'-check' );
2999 -
 3057+
30003058 # Construct search and replace arrays
30013059 wfProfileIn( $fname.'-construct' );
30023060 $wgOutputReplace = array();
@@ -3023,7 +3081,7 @@
30243082
30253083 # Do the thing
30263084 wfProfileIn( $fname.'-replace' );
3027 -
 3085+
30283086 $text = preg_replace_callback(
30293087 '/(<!--LINK .*?-->)/',
30303088 "wfOutputReplaceMatches",
@@ -3042,18 +3100,18 @@
30433101 $title = $this->mInterwikiLinkHolders['titles'][$key];
30443102 $wgOutputReplace[$key] = $sk->makeLinkObj( $title, $link );
30453103 }
3046 -
 3104+
30473105 $text = preg_replace_callback(
30483106 '/<!--IWLINK (.*?)-->/',
30493107 "wfOutputReplaceMatches",
30503108 $text );
30513109 wfProfileOut( $fname.'-interwiki' );
30523110 }
3053 -
 3111+
30543112 wfProfileOut( $fname );
30553113 return $colours;
30563114 }
3057 -
 3115+
30583116 /**
30593117 * Replace <!--LINK--> link placeholders with plain text of links
30603118 * (not HTML-formatted).
@@ -3071,11 +3129,11 @@
30723130 '/<!--(LINK|IWLINK) (.*?)-->/',
30733131 array( &$this, 'replaceLinkHoldersTextCallback' ),
30743132 $text );
3075 -
 3133+
30763134 wfProfileOut( $fname );
30773135 return $text;
30783136 }
3079 -
 3137+
30803138 /**
30813139 * @param array $matches
30823140 * @return string
@@ -3112,7 +3170,7 @@
31133171 global $wgUser, $wgTitle;
31143172 $parserOptions = ParserOptions::newFromUser( $wgUser );
31153173 $localParser = new Parser();
3116 -
 3174+
31173175 global $wgLinkCache;
31183176 $ig = new ImageGallery();
31193177 $ig->setShowBytes( false );
@@ -3137,10 +3195,10 @@
31383196 } else {
31393197 $label = '';
31403198 }
3141 -
 3199+
31423200 $html = $localParser->parse( $label , $wgTitle, $parserOptions );
31433201 $html = $html->mText;
3144 -
 3202+
31453203 $ig->add( new Image( $nt ), $html );
31463204 $wgLinkCache->addImageLinkObj( $nt );
31473205 }
@@ -3153,7 +3211,7 @@
31543212 function makeImage( &$nt, $options ) {
31553213 global $wgContLang, $wgUseImageResize;
31563214 global $wgUser, $wgThumbLimits;
3157 -
 3215+
31583216 $align = '';
31593217
31603218 # Check if the options text is of the form "options|alt text"
@@ -3346,7 +3404,7 @@
33473405
33483406 /** Get user options */
33493407 function initialiseFromUser( &$userInput ) {
3350 - global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages,
 3408+ global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages,
33513409 $wgAllowSpecialInclusion;
33523410 $fname = 'ParserOptions::initialiseFromUser';
33533411 wfProfileIn( $fname );
@@ -3396,12 +3454,12 @@
33973455 */
33983456 function wfNumberOfFiles() {
33993457 $fname = 'Parser::wfNumberOfFiles';
3400 -
 3458+
34013459 wfProfileIn( $fname );
34023460 $dbr =& wfGetDB( DB_SLAVE );
34033461 $res = $dbr->selectField('image', 'COUNT(*)', array(), $fname );
34043462 wfProfileOut( $fname );
3405 -
 3463+
34063464 return $res;
34073465 }
34083466
@@ -3432,7 +3490,7 @@
34333491 /**
34343492 * Escape html tags
34353493 * Basicly replacing " > and < with HTML entities ( &quot;, &gt;, &lt;)
3436 - *
 3494+ *
34373495 * @param string $in Text that might contain HTML tags
34383496 * @return string Escaped string
34393497 */
Index: trunk/phase3/includes/Title.php
@@ -385,7 +385,7 @@
386386 * @static (arguably)
387387 * @access public
388388 */
389 - function getInterwikiLink( $key ) {
 389+ function getInterwikiLink( $key, $transludeonly = false ) {
390390 global $wgMemc, $wgDBname, $wgInterwikiExpiry, $wgTitleInterwikiCache;
391391 $fname = 'Title::getInterwikiLink';
392392
@@ -407,7 +407,7 @@
408408
409409 $dbr =& wfGetDB( DB_SLAVE );
410410 $res = $dbr->select( 'interwiki',
411 - array( 'iw_url', 'iw_local' ),
 411+ array( 'iw_url', 'iw_local', 'iw_trans' ),
412412 array( 'iw_prefix' => $key ), $fname );
413413 if( !$res ) {
414414 wfProfileOut( $fname );
@@ -420,6 +420,7 @@
421421 $s = (object)false;
422422 $s->iw_url = '';
423423 $s->iw_local = 0;
 424+ $s->iw_trans = 0;
424425 }
425426 $wgMemc->set( $k, $s, $wgInterwikiExpiry );
426427 $wgTitleInterwikiCache[$k] = $s;
@@ -450,6 +451,24 @@
451452 }
452453
453454 /**
 455+ * Determine whether the object refers to a page within
 456+ * this project and is transcludable.
 457+ *
 458+ * @return bool TRUE if this is transcludable
 459+ * @access public
 460+ */
 461+ function isTrans() {
 462+ global $wgTitleInterwikiCache, $wgDBname;
 463+
 464+ if ($this->mInterwiki == '' || !$this->isLocal())
 465+ return false;
 466+ # Make sure key is loaded into cache
 467+ $this->getInterwikiLink( $this->mInterwiki );
 468+ $k = $wgDBname.':interwiki:' . $this->mInterwiki;
 469+ return (bool)($wgTitleInterwikiCache[$k]->iw_trans);
 470+ }
 471+
 472+ /**
454473 * Update the page_touched field for an array of title objects
455474 * @todo Inefficient unless the IDs are already loaded into the
456475 * link cache
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1556,4 +1556,14 @@
15571557 */
15581558 $wgHTTPTimeout = 3;
15591559
 1560+/**
 1561+ * Proxy to use for CURL requests.
 1562+ */
 1563+$wgHTTPProxy = false;
 1564+
 1565+/**
 1566+ * Enable interwiki transcluding. Only when iw_trans=1.
 1567+ */
 1568+$wgEnableScaryTransclude = false;
 1569+
15601570 ?>
Index: trunk/phase3/includes/HttpFunctions.php
@@ -6,7 +6,7 @@
77 * if $timeout is 'default', $wgHTTPTimeout is used
88 */
99 function wfGetHTTP( $url, $timeout = 'default' ) {
10 - global $wgServer, $wgHTTPTimeout;
 10+ global $wgServer, $wgHTTPTimeout, $wgHTTPProxy;
1111
1212
1313 # Use curl if available
@@ -14,7 +14,9 @@
1515 $c = curl_init( $url );
1616 if ( wfIsLocalURL( $url ) ) {
1717 curl_setopt( $c, CURLOPT_PROXY, 'localhost:80' );
18 - }
 18+ } else if ($wgHTTPProxy)
 19+ curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy);
 20+
1921 if ( $timeout == 'default' ) {
2022 $timeout = $wgHTTPTimeout;
2123 }
Index: trunk/phase3/languages/Language.php
@@ -236,7 +236,7 @@
237237 MAG_NOCONTENTCONVERT => array( 0, '__NOCONTENTCONVERT__', '__NOCC__'),
238238 MAG_CURRENTWEEK => array( 1, 'CURRENTWEEK' ),
239239 MAG_CURRENTDOW => array( 1, 'CURRENTDOW' ),
240 - MAG_REVISIONID => array( 1, 'REVISIONID' ),
 240+ MAG_REVISIONID => array( 1, 'REVISIONID' ),
241241 );
242242
243243 #-------------------------------------------------------------------
@@ -254,7 +254,7 @@
255255 # The navigation toolbar, int: is used here to make sure that the appropriate
256256 # messages are automatically pulled from the user-selected language file.
257257
258 -/*
 258+/*
259259 The sidebar for MonoBook is generated from this message, lines that do not
260260 begin with * or ** are discarded, furthermore lines that do begin with ** and
261261 do not contain | are also discarded, but don't depend on this behaviour for
@@ -624,19 +624,19 @@
625625 'passwordsent' => "A new password has been sent to the e-mail address
626626 registered for \"$1\".
627627 Please log in again after you receive it.",
628 -'eauthentsent' => "A confirmation email has been sent to the nominated email address.
629 -Before any other mail is sent to the account, you will have to follow the instructions in the email,
 628+'eauthentsent' => "A confirmation email has been sent to the nominated email address.
 629+Before any other mail is sent to the account, you will have to follow the instructions in the email,
630630 to confirm that the account is actually yours.",
631631 'loginend' => '&nbsp;',
632632 'mailerror' => "Error sending mail: $1",
633633 'acct_creation_throttle_hit' => 'Sorry, you have already created $1 accounts. You can\'t make any more.',
634634 'emailauthenticated' => 'Your email address was authenticated on $1.',
635 -'emailnotauthenticated' => 'Your email address is <strong>not yet authenticated</strong>. No email
 635+'emailnotauthenticated' => 'Your email address is <strong>not yet authenticated</strong>. No email
636636 will be sent for any of the following features.',
637 -'noemailprefs' => '<strong>No email address has been specified</strong>, the following
 637+'noemailprefs' => '<strong>No email address has been specified</strong>, the following
638638 features will not work.',
639639 'emailconfirmlink' => 'Confirm your e-mail address',
640 -'invalidemailaddress' => 'The email address cannot be accepted as it appears to have an invalid
 640+'invalidemailaddress' => 'The email address cannot be accepted as it appears to have an invalid
641641 format. Please enter a well-formatted address or empty that field.',
642642
643643 # Edit page toolbar
@@ -828,7 +828,7 @@
829829 <input type="hidden" name="num" value="50" />
830830 <input type="hidden" name="ie" value="$2" />
831831 <input type="hidden" name="oe" value="$2" />
832 -
 832+
833833 <input type="text" name="q" size="31" maxlength="255" value="$1" />
834834 <input type="submit" name="btnG" value="$3" />
835835 <div>
@@ -908,8 +908,8 @@
909909 # group editing
910910 'groups-editgroup' => 'Edit group',
911911 'groups-addgroup' => 'Add group',
912 -'groups-editgroup-preamble' => 'If the name or description starts with a colon, the
913 -remainder will be treated as a message name, and hence the text will be localised
 912+'groups-editgroup-preamble' => 'If the name or description starts with a colon, the
 913+remainder will be treated as a message name, and hence the text will be localised
914914 using the MediaWiki namespace',
915915 'groups-editgroup-name' => 'Group name: ',
916916 'groups-editgroup-description' => 'Group description (max 255 characters):<br />',
@@ -933,7 +933,7 @@
934934 'userrights-logcomment' => 'Changed group membership from $1 to $2',
935935
936936 # Default group names and descriptions
937 -#
 937+#
938938 'group-anon-name' => 'Anonymous',
939939 'group-anon-desc' => 'Anonymous users',
940940 'group-loggedin-name' => 'User',
@@ -987,9 +987,9 @@
988988 'uploaderror' => 'Upload error',
989989 'uploadtext' =>
990990 "
991 -Use the form below to upload new files,
 991+Use the form below to upload new files,
992992 to view or search previously uploaded images
993 -go to the [[Special:Imagelist|list of uploaded files]],
 993+go to the [[Special:Imagelist|list of uploaded files]],
994994 uploads and deletions are also logged in the [[Special:Log|project log]].
995995
996996 You must also check the box affirming that you are not
@@ -997,7 +997,7 @@
998998 Press the \"Upload\" button to finish the upload.
999999
10001000 To include the image in a page, use a link in the form
1001 -'''<nowiki>[[{{ns:6}}:file.jpg]]</nowiki>''',
 1001+'''<nowiki>[[{{ns:6}}:file.jpg]]</nowiki>''',
10021002 '''<nowiki>[[{{ns:6}}:file.png|alt text]]</nowiki>''' or
10031003 '''<nowiki>[[{{ns:-2}}:file.ogg]]</nowiki>''' for directly linking to the file.
10041004 ",
@@ -1582,7 +1582,7 @@
15831583 'movereason' => 'Reason',
15841584 'revertmove' => 'revert',
15851585 'delete_and_move' => 'Delete and move',
1586 -'delete_and_move_text' =>
 1586+'delete_and_move_text' =>
15871587 '==Deletion required==
15881588
15891589 The destination article "[[$1]]" already exists. Do you want to delete it to make way for the move?',
@@ -1776,7 +1776,7 @@
17771777 'newimages' => 'New images gallery',
17781778 'noimages' => 'Nothing to see.',
17791779
1780 -# short names for language variants used for language conversion links.
 1780+# short names for language variants used for language conversion links.
17811781 # to disable showing a particular link, set it to 'disable', e.g.
17821782 # 'variantname-zh-sg' => 'disable',
17831783 'variantname-zh-cn' => 'cn',
@@ -2119,11 +2119,15 @@
21202120 'searchfulltext' => 'Search full text',
21212121 'createarticle' => 'Create article',
21222122
 2123+# Scary transclusion
 2124+'scarytranscludedisabled' => '[Interwiki transcluding is disabled]',
 2125+'scarytranscludefailed' => '[Template fetch failed; sorry]',
 2126+
21232127 );
21242128
21252129 /* a fake language converter */
21262130 class fakeConverter {
2127 - var $mLang;
 2131+ var $mLang;
21282132 function fakeConverter($langobj) {$this->mLang = $langobj;}
21292133 function convert($t, $i) {return $t;}
21302134 function getVariants() { return array( strtolower( substr( get_class( $this->mLang ), 8 ) ) ); }
@@ -2163,19 +2167,19 @@
21642168 }
21652169 $this->mConverter = new fakeConverter($this);
21662170 }
2167 -
 2171+
21682172 /**
21692173 * Exports the default user options as defined in
21702174 * $wgDefaultUserOptionsEn, user preferences can override some of these
21712175 * depending on what's in (Local|Default)Settings.php and some defines.
2172 - *
 2176+ *
21732177 * @return array
21742178 */
21752179 function getDefaultUserOptions() {
21762180 global $wgDefaultUserOptionsEn ;
21772181 return $wgDefaultUserOptionsEn ;
21782182 }
2179 -
 2183+
21802184 /**
21812185 * Exports $wgBookstoreListEn
21822186 * @return array
@@ -2184,7 +2188,7 @@
21852189 global $wgBookstoreListEn ;
21862190 return $wgBookstoreListEn ;
21872191 }
2188 -
 2192+
21892193 /**
21902194 * @return array
21912195 */
@@ -2223,7 +2227,7 @@
22242228 $ns = $this->getNamespaces();
22252229 return isset( $ns[$index] ) ? $ns[$index] : false;
22262230 }
2227 -
 2231+
22282232 /**
22292233 * A convenience function that returns the same thing as
22302234 * getNsText() except with '_' changed to ' ', useful for
@@ -2244,7 +2248,7 @@
22452249 */
22462250 function getNsIndex( $text ) {
22472251 $ns = $this->getNamespaces();
2248 -
 2252+
22492253 foreach ( $ns as $i => $n ) {
22502254 if ( strcasecmp( $n, $text ) == 0)
22512255 return $i;
@@ -2253,7 +2257,7 @@
22542258 }
22552259
22562260 /**
2257 - * short names for language variants used for language conversion links.
 2261+ * short names for language variants used for language conversion links.
22582262 *
22592263 * @param string $code
22602264 * @return string
@@ -2380,7 +2384,7 @@
23812385 (int)substr( $ts, 0, 4 ) ); #Year
23822386 return date( 'YmdHis', $t );
23832387 }
2384 -
 2388+
23852389 /**
23862390 * This is meant to be used by time(), date(), and timeanddate() to get
23872391 * the date preference they're supposed to use, it should be used in
@@ -2405,7 +2409,7 @@
24062410 return $wgUser->getOption( 'date' );
24072411 }
24082412 }
2409 -
 2413+
24102414 /**
24112415 * @access public
24122416 * @param mixed $ts the time format which needs to be turned into a
@@ -2420,17 +2424,17 @@
24212425 */
24222426 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
24232427 global $wgAmericanDates, $wgUser;
2424 -
 2428+
24252429 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
2426 -
 2430+
24272431 $datePreference = $this->dateFormat($format);
2428 -
 2432+
24292433 if ($datePreference == '0') {$datePreference = $wgAmericanDates ? '0' : '2';}
24302434
24312435 $month = $this->getMonthName( substr( $ts, 4, 2 ) );
24322436 $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
24332437 $year = $this->formatNum( substr( $ts, 0, 4 ), true );
2434 -
 2438+
24352439 switch( $datePreference ) {
24362440 case '2': return "$day $month $year";
24372441 case '3': return "$year $month $day";
@@ -2456,17 +2460,17 @@
24572461
24582462 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
24592463 $datePreference = $this->dateFormat($format);
2460 -
 2464+
24612465 if ($datePreference == '0') {$datePreference = $wgAmericanDates ? '0' : '2';}
24622466
24632467 $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
2464 -
 2468+
24652469 if ( $datePreference === 'ISO 8601' ) {
24662470 $t .= ':' . substr( $ts, 12, 2 );
24672471 }
24682472 return $this->formatNum( $t );
24692473 }
2470 -
 2474+
24712475 /**
24722476 * @access public
24732477 * @param mixed $ts the time format which needs to be turned into a
@@ -2481,9 +2485,9 @@
24822486 */
24832487 function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
24842488 global $wgUser, $wgAmericanDates;
2485 -
 2489+
24862490 $datePreference = $this->dateFormat($format);
2487 -
 2491+
24882492 switch ( $datePreference ) {
24892493 case 'ISO 8601': return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ' ' .
24902494 $this->time( $ts, $adj, $datePreference, $timecorrection );
@@ -2550,7 +2554,7 @@
25512555 # it with one to detect and convert another legacy encoding.
25522556 return $s;
25532557 }
2554 -
 2558+
25552559 /**
25562560 * Some languages have special punctuation to strip out
25572561 * or characters which need to be converted for MySQL's
@@ -2567,7 +2571,7 @@
25682572 # some languages, e.g. Chinese, need to do a conversion
25692573 # in order for search results to be displayed correctly
25702574 return $termsArray;
2571 - }
 2575+ }
25722576
25732577 /**
25742578 * Get the first character of a string. In ASCII, return
@@ -2659,8 +2663,8 @@
26602664 $mw->mCaseSensitive = $rawEntry[0];
26612665 $mw->mSynonyms = array_slice( $rawEntry, 1 );
26622666 }
2663 -
2664 - /**
 2667+
 2668+ /**
26652669 * Italic is unsuitable for some languages
26662670 *
26672671 * @access public
@@ -2675,34 +2679,34 @@
26762680 /**
26772681 * This function enables formatting of numbers, it should only come
26782682 * into effect when the $wgTranslateNumerals variable is TRUE.
2679 - *
 2683+ *
26802684 * Normally we output all numbers in plain en_US style, that is
26812685 * 293,291.235 for twohundredninetythreethousand-twohundredninetyone
26822686 * point twohundredthirtyfive. However this is not sutable for all
26832687 * languages, some such as Pakaran want ੨੯੩,੨੯੫.੨੩੫ and others such as
26842688 * Icelandic just want to use commas instead of dots, and dots instead
26852689 * of commas like "293.291,235".
2686 - *
 2690+ *
26872691 * An example of this function being called:
26882692 * <code>
26892693 * wfMsg( 'message', $wgLang->formatNum( $num ) )
26902694 * </code>
2691 - *
 2695+ *
26922696 * See LanguageGu.php for the Gujarati implementation and
26932697 * LanguageIs.php for the , => . and . => , implementation.
2694 - *
 2698+ *
26952699 * @todo check if it's viable to use localeconv() for the decimal
26962700 * seperator thing.
26972701 * @access public
26982702 * @param mixed $number the string to be formatted, should be an integer or
2699 - * a floating point number.
 2703+ * a floating point number.
27002704 * @param bool $year are we being passed a year? (turns off commafication)
27012705 * @return mixed whatever we're fed if it's a year, a string otherwise.
27022706 */
27032707 function formatNum( $number, $year = false ) {
27042708 return $year ? $number : $this->commafy($number);
27052709 }
2706 -
 2710+
27072711 /**
27082712 * Adds commas to a given number
27092713 *
@@ -2779,7 +2783,7 @@
27802784 function segmentForDiff( $text ) {
27812785 return $text;
27822786 }
2783 -
 2787+
27842788 /**
27852789 * and unsegment to show the result
27862790 *
@@ -2794,7 +2798,7 @@
27952799 function convert( $text, $isTitle = false) {
27962800 return $this->mConverter->convert($text, $isTitle);
27972801 }
2798 -
 2802+
27992803 /**
28002804 * Perform output conversion on a string, and encode for safe HTML output.
28012805 * @param string $text
@@ -2828,7 +2832,7 @@
28292833 /**
28302834 * if a language supports multiple variants, it is
28312835 * possible that non-existing link in one variant
2832 - * actually exists in another variant. this function
 2836+ * actually exists in another variant. this function
28332837 * tries to find it. See e.g. LanguageZh.php
28342838 *
28352839 * @param string $link the name of the link
@@ -2854,17 +2858,17 @@
28552859 * for languages that support multiple variants, the title of an
28562860 * article may be displayed differently in different variants. this
28572861 * function returns the apporiate title defined in the body of the article.
2858 - *
 2862+ *
28592863 * @return string
28602864 */
28612865 function getParsedTitle() {
28622866 return $this->mConverter->getParsedTitle();
28632867 }
2864 -
 2868+
28652869 /**
28662870 * Enclose a string with the "no conversion" tag. This is used by
28672871 * various functions in the Parser
2868 - *
 2872+ *
28692873 * @param string $text text to be tagged for no conversion
28702874 * @return string the tagged text
28712875 */

Status & tagging log