From: Brion Vibber Date: Thu, 28 Oct 2004 01:27:16 +0000 (+0000) Subject: Don't include the special markers like "right" as alt text; leave it blank if there... X-Git-Tag: 1.5.0alpha1~1432 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=a160b41355d6618a754a3f34bbb802b274e27122;p=lhc%2Fweb%2Fwiklou.git Don't include the special markers like "right" as alt text; leave it blank if there's no final alt block. * Running test Right-aligned image... PASSED --- diff --git a/includes/Skin.php b/includes/Skin.php index cc14ae28b9..3db1043560 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1696,7 +1696,7 @@ class Skin { $mwWidth =& MagicWord::get( MAG_IMG_WIDTH ); $mwCenter =& MagicWord::get( MAG_IMG_CENTER ); $mwFramed =& MagicWord::get( MAG_IMG_FRAMED ); - $alt = $part[count($part)-1]; + $alt = ''; $height = $framed = $thumb = false; $manual_thumb = "" ; @@ -1732,6 +1732,8 @@ class Skin { } } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) { $framed=true; + } else { + $alt = $val; } } if ( 'center' == $align ) @@ -1770,9 +1772,6 @@ class Skin { if ( '' == $manual_thumb ) $url = $img->createThumb( $width ); } - if ( empty( $alt ) ) { - $alt = preg_replace( '/\.(.+?)^/', '', $img->getName() ); - } $alt = preg_replace( '/<[^>]*>/', '', $alt ); $alt = preg_replace('/&(?!:amp;|#[Xx][0-9A-fa-f]+;|#[0-9]+;|[a-zA-Z0-9]+;)/', '&', $alt); $alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt );