$alt = preg_replace( '/\.(.+?)^/', '', $img->getName() );
}
$alt = preg_replace( '/<[^>]*>/', '', $alt );
- $alt = htmlspecialchars( $alt );
+ $alt = preg_replace('/&(?!:amp;|#[Xx][0-9A-fa-f]+;|#[0-9]+;|[a-zA-Z0-9]+;)/', '&', $alt);
+ $alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt );
$u = $nt->escapeLocalURL();
if ( $url == '' )
#$label = htmlspecialchars( $label );
$alt = preg_replace( '/<[^>]*>/', '', $label);
- $alt = htmlspecialchars( $alt );
+ $alt = preg_replace('/&(?!:amp;|#[Xx][0-9A-fa-f]+;|#[0-9]+;|[a-zA-Z0-9]+;)/', '&', $alt);
+ $alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt );
$width = $height = 0;
if ( $img->exists() )