From a160b41355d6618a754a3f34bbb802b274e27122 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 28 Oct 2004 01:27:16 +0000 Subject: [PATCH] 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 --- includes/Skin.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 ); -- 2.20.1