Merge "(bug 56849) Deprecate dangerous edittime-based content update functions"
[lhc/web/wiklou.git] / includes / Linker.php
index 7724548..aa5325d 100644 (file)
@@ -408,6 +408,11 @@ class Linker {
         * @return string
         */
        public static function makeSelfLinkObj( $nt, $html = '', $query = '', $trail = '', $prefix = '' ) {
+               $ret = "<strong class=\"selflink\">{$prefix}{$html}</strong>{$trail}";
+               if ( !wfRunHooks( 'SelfLinkBegin', array( $nt, &$html, &$trail, &$prefix, &$ret ) ) ) {
+                       return $ret;
+               }
+
                if ( $html == '' ) {
                        $html = htmlspecialchars( $nt->getPrefixedText() );
                }
@@ -603,7 +608,6 @@ class Linker {
                                }
 
                                // Reduce width for upright images when parameter 'upright' is used
-                               $useSquare = !isset( $fp['upright'] );
                                if ( isset( $fp['upright'] ) && $fp['upright'] == 0 ) {
                                        $fp['upright'] = $wgThumbUpright;
                                }
@@ -615,16 +619,11 @@ class Linker {
                                        round( $wgThumbLimits[$widthOption] * $fp['upright'], -1 ) :
                                        $wgThumbLimits[$widthOption];
 
-                               // Use whichever is smaller: real image width or user preference width
+                               // Use width which is smaller: real image width or user preference width
                                // Unless image is scalable vector.
                                if ( !isset( $hp['height'] ) && ( $hp['width'] <= 0 ||
-                                               $prefWidth < $hp['width'] ||
-                                               ( $useSquare && $prefWidth < $file->getHeight( $page ) ) ||
-                                               $file->isVectorized() ) ) {
+                                               $prefWidth < $hp['width'] || $file->isVectorized() ) ) {
                                        $hp['width'] = $prefWidth;
-                                       if ( $useSquare ) {
-                                               $hp['height'] = $prefWidth;
-                                       }
                                }
                        }
                }