summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.class2
-rwxr-xr-xtests/html.t2
2 files changed, 2 insertions, 2 deletions
diff --git a/html.class b/html.class
index d1fb5d2..fd60a1d 100644
--- a/html.class
+++ b/html.class
@@ -254,7 +254,7 @@ function sanitize($html)
{
# Image tags, keeps only src attribute
list($head, $src, $tail) = $tag;
- $result .= it_html::sanitize($head) . "<img src=\"$src\" />" . it_html::sanitize($tail);
+ $result .= it_html::sanitize($head) . "<img src=\"$src\" alt=\"\" />" . it_html::sanitize($tail);
}
else if ($tag = it::match("(.*)<(br)[^>]*>(.*)", $html))
{
diff --git a/tests/html.t b/tests/html.t
index 071685e..965e4a1 100755
--- a/tests/html.t
+++ b/tests/html.t
@@ -85,7 +85,7 @@ is(
<p><a href="javascript:window.close()" title="Wolken"><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" width="240" height="180" alt="Wolken" style="border: 1px solid #ddd;" /></a></p>
'),
- ' <a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted &lt; &lt; ä &amp; yesterday a <i>photo</i> <i>tag missmatch</i>:<br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" /></p> ',
+ ' <a href="http://www.flickr.com/people/swisspics/">swisspics</a> posted &lt; &lt; ä &amp; yesterday a <i>photo</i> <i>tag missmatch</i>:<br /><br /> <p><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" alt="" /></p> ',
'it_html::sanitize tag soup'
);