Re: Bug in Kannel WML Compiler??

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi List,

would please anyone review/comment this patch, Stipe?


On Monday 29 March 2004 19:14, Jörg Pommnitz wrote:
> Hi List,
> attached is a patch to the Kannel WML compiler that fixes the
> problem described in my original post.
>
> With this patch applied, the following test WML document:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
> "http://www.wapforum.org/DTD/wml_1.1.xml">
> <wml>
> <card id="c1" title="A WMLC Testcase">
>     <onevent type="onenterforward">
> 	<refresh>
> 		<setvar name="XY" value="This is the content"/>
> 	</refresh>
>     </onevent>
>     <p align="left">
> 	<a href="http://wap.url.mobile/path?XY=$XY">$XY</a><br/>
> 	<a href="http://wap.url.mobile/path?XY=$(XY)">$(XY)</a><br/>
> 	<a
> href="http://wap.url.mobile/path?XY=$(XY:escape)">$(XY:escape)</a><br/>
> 	<a
> href="http://wap.url.mobile/path?XY=$(XY:noesc)">$(XY:noesc)</a><br/>
> 	<a
> href="http://wap.url.mobile/path?XY=$(XY:unesc)">$(XY:unesc)</a><br/>
>     </p>
> </card>
> </wml>
>
> results in the following (decompiled) binary:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
> "http://www.wapforum.org/DTD/wml_1.1.xml">
> <wml>
> <card id="c1" title="A WMLC Testcase" >
> <onevent type="onenterforward" >
> <refresh>
> <setvar name="XY" value="This is the content" />
> </refresh>
> </onevent>
> <p align="left" >
> <a href="http://wap.url.mobile/path?XY=$(XY:escape)" >$(XY:noesc)</a>
> <br />
> <a href="http://wap.url.mobile/path?XY=$(XY:escape)" >$(XY:noesc)</a>
> <br />
> <a href="http://wap.url.mobile/path?XY=$(XY:escape)" >$(XY:escape)</a>
> <br />
> <a href="http://wap.url.mobile/path?XY=$(XY:noesc)" >$(XY:noesc)</a>
> <br />
> <a href="http://wap.url.mobile/path?XY=$(XY:unesc)" >$(XY:unesc)</a>
> <br />
> </p>
> </card>
> </wml>
>
> As you can see, the compiler now chooses the right conversion for the
> context, when no conversion is supplied.
>
> Regards
>   Jörg
>
> -----Ursprüngliche Nachricht-----
> Von: Jörg Pommnitz
> Gesendet: Montag, 29. März 2004 16:21
> An: Kannel-Devel (E-Mail)
> Betreff: Bug in Kannel WML Compiler??
>
>
> Hello all,
> I suspect that there is a small bug in the Kannel WML compiler.
> The bug is related to variable substitution as specified in
> http://www.openmobilealliance.org/tech/affiliates/wap/wap-191-wml-20000219-
>a .pdf
> . Section 10.3.1 Variable Substitution says:
>
> "If no conversion is specified, the variable is substituted using the
> conversion format appropriate for the context. All attributes defined
> as %HREF; default to escape conversion, elsewhere no conversion is
> done. Specifying the noesc conversion disables context sensitive
> escaping of a variable."
>
> The WML binary standard does not provide a token for a variable
> substitution without conversion (the defined tokens are EXT_I_0
> ..EXT_I_2, EXT_T_0..EXT_T_2), that's why the WML compiler has to choose
> the correct one. Currently the WML compiler unconditionaly uses
> the "noesc" conversion for all contexts, even in the href attribute:
> http://www.kannel.org/cgi-bin/lxr/source/gateway/gw/wml_compiler.c#L1107
>
> Unfortunately the function "check_variable_syntax" does not even
> know the context. Any suggestions?
>
> Regards
>   Jörg

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: a.malysh (at) centrium.de
web: www.centrium.de
msn: a.malysh (at) centrium.de
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBAhBSqnX3e5W+uJ0ERAg65AJ95AKcoediW02G0ieV5F7pQKT4HewCgwdbk
KSkKPlHVMV7q7qMQMLKhnc8=
=4qTg
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.