* Removed redudant global decleration
[lhc/web/wiklou.git] / includes / Linker.php
index 81e31e5..54daa1a 100644 (file)
@@ -221,6 +221,13 @@ class Linker {
 
        /**
         * Pass a title object, not a title string
+        * @param object Title of target page
+        * @param string Text to replace the title
+        * @param string Link target
+        * @param string Text after link
+        * @param string Text before link text
+        * @param string Extra attributes to the a-element
+        * @return the a-element
         */
        function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' ) {
                global $wgTitle;
@@ -252,6 +259,8 @@ class Linker {
                        $text = htmlspecialchars( $nt->getPrefixedText() );
                }
                $style = $this->getInternalLinkAttributesObj( $nt, $text );
+
+               if ( $aprops !== '' ) $aprops = ' ' . $aprops;
                
                list( $inside, $trail ) = Linker::splitTrail( $trail );
                $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}";
@@ -323,7 +332,7 @@ class Linker {
         */
        function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                global $wgUser;
-               $threshold = IntVal( $wgUser->getOption( 'stubthreshold' ) );
+               $threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
                if( $size < $threshold ) {
                        return $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
                } else {
@@ -410,8 +419,9 @@ class Linker {
                        }
                        
                        return $prefix.$this->makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
+               }
 
-               } elseif ( $width ) {
+               if ( $width && $img->exists() ) {
 
                        # Create a resized image, without the additional thumbnail
                        # features
@@ -601,7 +611,7 @@ class Linker {
                        if( $img->exists() ) {
                                $url  = $img->getURL();
                                if( $nourl ) {
-                                       $url = str_replace( "http://", "http-noparse://", $url );
+                                       $url = str_replace( "http://", UNIQ_PREFIX . "NOPARSEhttp://", $url );
                                }
                                $class = 'internal';
                        } else {