r42023 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42022‎ | r42023 | r42024 >
Date:09:31, 13 October 2008
Author:mattj
Status:old (Comments)
Tags:
Comment:
Fix r42022, always returning true for isValidInterwiki as I forgot to add the check.
Modified paths:
  • /trunk/phase3/includes/Interwiki.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Interwiki.php
@@ -50,7 +50,7 @@
5151 unset( self::$smCache[ key( self::$smCache ) ] );
5252 }
5353 self::$smCache[$prefix] = $iw;
54 - return true;
 54+ return ($iw != false);
5555 }
5656
5757 /**
@@ -175,7 +175,9 @@
176176 $iw = false;
177177 if( $mc && is_array( $mc ) ){ // is_array is hack for old keys
178178 $iw = Interwiki::loadFromArray( $mc );
179 - return $iw;
 179+ if( $iw ){
 180+ return $iw;
 181+ }
180182 }
181183
182184 $db = wfGetDB( DB_SLAVE );
Index: trunk/phase3/includes/Title.php
@@ -675,7 +675,7 @@
676676 $query = wfArrayToCGI( $query );
677677 }
678678
679 - if ( '' == $this->mInterwiki ) {
 679+ if ( '' == $this->mInterwiki || !Interwiki::isValidInterwiki( $this->mInterwiki ) ) {
680680 $url = $this->getLocalUrl( $query, $variant );
681681
682682 // Ugly quick hack to avoid duplicate prefixes (bug 4571 etc)

Follow-up revisions

RevisionCommit summaryAuthorDate
r42041Cleanup for r42022/r42023 interwiki stuff...brion18:43, 13 October 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r42022Clean up Interwiki.php to meet Tim's suggestions. Hopefully should make clean...mattj08:35, 13 October 2008

Comments

#Comment by Siebrand (talk | contribs)   14:07, 13 October 2008

Looks like I am still getting

PHP Fatal error:  Call to a member function getURL() on a non-object in /var/www/w/includes/Title.php on line 687

Although not as frequently as with r42022 it seems. No idea where it comes from exactly, as Betawiki outputs errors, warnings and notices to #mediawiki-i18n.

#Comment by Brion VIBBER (talk | contribs)   18:46, 13 October 2008

r42041 resolved this for betawiki.

Status & tagging log