From a8d1b7e7887dcec03ac6b66d5faf3e418130fc6b Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Thu, 29 Jan 2004 23:15:30 +0000 Subject: [PATCH] Break backwards compatibility: Make image links parse for extended syntax even if only the alt attribute is set (upon ErikMoellers request) --- includes/Skin.php | 50 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index f3c5ef449f..c90923b5ec 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1447,32 +1447,30 @@ class Skin { $part = explode( "|", $alt); - if ( count($part) > 1 ) { - $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL ); - $mwLeft =& MagicWord::get( MAG_IMG_LEFT ); - $mwRight =& MagicWord::get( MAG_IMG_RIGHT ); - $mwNone =& MagicWord::get( MAG_IMG_NONE ); - $mwWidth =& MagicWord::get( MAG_IMG_WIDTH ); - $alt = $part[count($part)-1]; - - $thumb=false; - - foreach( $part as $key => $val ) { - if ( ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) { - $thumb=true; - } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) { - # remember to set an alignment, don't render immediately - $align = "right"; - } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) { - # remember to set an alignment, don't render immediately - $align = "left"; - } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) { - # remember to set an alignment, don't render immediately - $align = "none"; - } elseif ( ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) { - # $match is the image width in pixels - $width = intval($match); - } + $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL ); + $mwLeft =& MagicWord::get( MAG_IMG_LEFT ); + $mwRight =& MagicWord::get( MAG_IMG_RIGHT ); + $mwNone =& MagicWord::get( MAG_IMG_NONE ); + $mwWidth =& MagicWord::get( MAG_IMG_WIDTH ); + $alt = $part[count($part)-1]; + + $thumb=false; + + foreach( $part as $key => $val ) { + if ( ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) { + $thumb=true; + } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) { + # remember to set an alignment, don't render immediately + $align = "right"; + } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) { + # remember to set an alignment, don't render immediately + $align = "left"; + } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) { + # remember to set an alignment, don't render immediately + $align = "none"; + } elseif ( ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) { + # $match is the image width in pixels + $width = intval($match); } } -- 2.20.1