Matus UHLAR - fantomas <[email protected]> writes:
> my wwwoffle 2.9h replaces image as webbug when set to "auto" size.
>
> I see this in source on http://www.cas.sk/galeria/297594/?foto=1
> (I selected theimage andsed "show selection source" in mozilla)
>
> <a xmlns="http://www.w3.org/1999/xhtml" href="?foto=2">
> <!-- WWWOFFLE (replace-webbug-images) - img width="auto"
> height="auto" id="imgBig1" class="imgBig"
> src="http://img.cas.sk/img/4/galleryBig/1350294_.jpg" title="Erika
> Barkolová s Patríciou a Alexandrou" alt="Erika Barkolová s
> Patríciou a Alexandrou" --><img height="auto" width="auto" alt=""
> title="" src="http://localhost:8080/local/dontget/replacement.gif"
> class="imgBig" id="imgBig1" style="width: 530px; height: auto; max-width:
> 564px;"/>
> </a>
>
> am I right this is a bug?
Yes, this is a bug. WWWOFFLE was not expecting that the height or
width could be anything other than a number.
This patch below should fix the problem.
-------------------- htmlmodify.l.diff --------------------
Index: src/htmlmodify.l
===================================================================
--- src/htmlmodify.l (revision 2174)
+++ src/htmlmodify.l (working copy)
@@ -638,9 +638,9 @@
int width=1000,height=1000;
for(i=0;i<tag->nattr;i++)
- if(tag->attr_type[i]==att_width && tag->attr_val[i])
+ if(tag->attr_type[i]==att_width && tag->attr_val[i] &&
isdigit(tag->attr_val[i][0]))
width=atoi(tag->attr_val[i]);
- else if(tag->attr_type[i]==att_height && tag->attr_val[i])
+ else if(tag->attr_type[i]==att_height && tag->attr_val[i] &&
isdigit(tag->attr_val[i][0]))
height=atoi(tag->attr_val[i]);
if(width<=1 && height<=1)
-------------------- htmlmodify.l.diff --------------------
>From your example though I can see another type of webbug that
WWWOFFLE will not detect:
<img width="10" height="10" src="..." style="width: 0px; height: 0px;"/>
The HTML part is a non-zero size but the CSS part is zero size.
WWWOFFLE only checks the HTML and not the CSS (parsing one within the
other is difficult and the relevant CSS might not be in the <img> tag
but in a style sheet or in a <style> tag somewhere else).
--
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop [email protected]
http://www.gedanken.demon.co.uk/
WWWOFFLE homepage: http://www.gedanken.demon.co.uk/wwwoffle/