r9390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9389‎ | r9390 | r9391 >
Date:01:54, 11 June 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 2372) Fix rendering of empty-title inline interwiki links
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -1070,6 +1070,15 @@
10711071 !! end
10721072
10731073 !! test
 1074+Inline interwiki link with empty title (bug 2372)
 1075+!! input
 1076+[[MeatBall:]]
 1077+!! result
 1078+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class='extiw' title="MeatBall:">MeatBall:</a>
 1079+</p>
 1080+!! end
 1081+
 1082+!! test
10741083 Interwiki link encoding conversion (bug 1636)
10751084 !! input
10761085 *[[Wikipedia:ro:Olteni&#0355;a]]
Index: trunk/phase3/includes/Parser.php
@@ -1433,7 +1433,13 @@
14341434 $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail );
14351435 continue;
14361436 }
1437 - if ( $nt->isAlwaysKnown() ) {
 1437+ if( $nt->isLocal() && $nt->isAlwaysKnown() ) {
 1438+ /**
 1439+ * Skip lookups for special pages and self-links.
 1440+ * External interwiki links are not included here because
 1441+ * the HTTP urls would break output in the next parse step;
 1442+ * they will have placeholders kept.
 1443+ */
14381444 $s .= $sk->makeKnownLinkObj( $nt, $text, '', $trail, $prefix );
14391445 } else {
14401446 /**
Index: trunk/phase3/includes/Title.php
@@ -1969,7 +1969,7 @@
19701970 *
19711971 */
19721972 function isAlwaysKnown() {
1973 - return ( 0 == $this->mNamespace && "" == $this->mDbkeyform )
 1973+ return $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform )
19741974 || NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace;
19751975 }
19761976
Index: trunk/phase3/RELEASE-NOTES
@@ -275,6 +275,7 @@
276276 * Changed user_groups format quite a bit.
277277 * (bug 2368) Avoid fatally breaking PHP 4.1.2 in a debug line
278278 * (bug 2367) Insert correct redirect link record on page move
 279+* (bug 2372) Fix rendering of empty-title inline interwiki links
279280
280281
281282 === Caveats ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r41507Reverting r41410 -- broke interwikis totally in parser tests....brion16:59, 1 October 2008

Status & tagging log