[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: [2.0.3] Bug in wml_p7_htmlfix: Inserts quotes into URL



On Wed, Sep 13, 2000 at 02:03:03PM +0200, Roland Rosenfeld wrote:

> After upgrading to 2.0.3 I noticed a strange bug in wml_p7_htmlfix,
> when processing the following HTML code:
> 
> <a href="http://mapweb.parc.xerox.com/map/color=1/features=alltypes/ht=22.48/lat=50.80/lon=7.03/mark=50.80,7.03/wd=45.00">
> 
> IMHO htmlfix shouldn't change anything on this code, but since 2.0.3
> this is converted to
> 
> <a href="http://mapweb.parc.xerox.com/map/color="1"/features="alltypes"/ht="22.48"/lat="50.80"/lon="7.03"/mark="50.80,7.03"/wd=45.00">
> 
> It's possible to track this problem down to a simpler case:
> 
> $ echo '<a href="http://foo.bar/baz=1/">' | wml -p7
> <a href="http://foo.bar/baz="1"/">

Hi Roland,

this is indeed a bug i introduced when taking trailing slash in
attributes into account.
Here is a patch:

--- wml_backend/p7_htmlfix/htmlfix.src  2000/09/02 23:06:32     1.11
+++ wml_backend/p7_htmlfix/htmlfix.src  2000/09/13 21:26:21
@@ -247,7 +247,7 @@
     while ($buffer =~ m|\G(.*?)(<[a-zA-Z_][^>]*>)|sg) {
         $last = pos($buffer);
         ($prolog, $tag) = ($1, $2);
-        $tag =~ s|([A-Za-z_-]+=)([^\s\"\'/><\[]+)([\s/>])|$1"$2"$3|sg;
+        $tag =~ s@([A-Za-z_-]+=)([^\s\"\'><\[]+)(\s|/?>)@$1"$2"$3@sg;
         $bufferN .= $prolog.$tag;
     }   

Thanks for your report.

-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com