Merge "Update mediawiki.ui button styles"
[lhc/web/wiklou.git] / includes / parser / ParserOutput.php
index 2950227..8cd978b 100644 (file)
@@ -59,8 +59,8 @@ class ParserOutput extends CacheTime {
        const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
 
        function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
-               $containsOldMagic = false, $titletext = '' )
-       {
+               $containsOldMagic = false, $titletext = ''
+       {
                $this->mText = $text;
                $this->mLanguageLinks = $languageLinks;
                $this->mCategories = $categoryLinks;
@@ -279,10 +279,10 @@ class ParserOutput extends CacheTime {
         * @throws MWException if given invalid input
         */
        function addInterwikiLink( $title ) {
-               $prefix = $title->getInterwiki();
-               if ( $prefix == '' ) {
+               if ( !$title->isExternal() ) {
                        throw new MWException( 'Non-interwiki link passed, internal parser error.' );
                }
+               $prefix = $title->getInterwiki();
                if ( !isset( $this->mInterwikiLinks[$prefix] ) ) {
                        $this->mInterwikiLinks[$prefix] = array();
                }