* (bug 23460) Parse action should have a section option
[lhc/web/wiklou.git] / includes / Linker.php
index 5d1f096..1398a44 100644 (file)
@@ -485,7 +485,9 @@ class Linker {
                                        round( $wgThumbLimits[$wopt] * $fp['upright'], -1 ) :
                                        $wgThumbLimits[$wopt];
                                if ( $hp['width'] <= 0 || $prefWidth < $hp['width'] ) {
-                                       $hp['width'] = $prefWidth;
+                                       if( !isset( $hp['height'] ) ) {
+                                               $hp['width'] = $prefWidth;
+                                       }
                                }
                        }
                }
@@ -968,7 +970,7 @@ class Linker {
                $comment = Sanitizer::escapeHtmlAllowEntities( $comment );
 
                # Render autocomments and make links:
-               $comment = $this->formatAutoComments( $comment, $title, $local );
+               $comment = $this->formatAutocomments( $comment, $title, $local );
                $comment = $this->formatLinksInComment( $comment, $title, $local );
 
                wfProfileOut( __METHOD__ );
@@ -1005,11 +1007,11 @@ class Linker {
                $title = $this->autocommentTitle;
                $local = $this->autocommentLocal;
 
-               $pre=$match[1];
-               $auto=$match[2];
-               $post=$match[3];
-               $link='';
-               if( $title ) {
+               $pre = $match[1];
+               $auto = $match[2];
+               $post = $match[3];
+               $link = '';
+               if ( $title ) {
                        $section = $auto;
 
                        # Generate a valid anchor name from the section title.
@@ -1112,7 +1114,9 @@ class Linker {
 
                        $target = Title::newFromText( $linkTarget );
                        if( $target ) {
-                               if( $target->getText() == '' && !$this->commentLocal && $this->commentContextTitle ) {
+                               if( $target->getText() == '' && $target->getInterwiki() === ''
+                                       && !$this->commentLocal && $this->commentContextTitle )
+                               {
                                        $newTarget = clone( $this->commentContextTitle );
                                        $newTarget->setFragment( '#' . $target->getFragment() );
                                        $target = $newTarget;