--
You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to opensocial-an...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
> >> opensocial-and-gadg...@googlegroups.com<opensocial-and-gad gets-spec%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "OpenSocial and Gadgets Specification Discussion" group.
> > To post to this group, send email to
> > opensocial-an...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > opensocial-and-gadg...@googlegroups.com<opensocial-and-gad gets-spec%2Bunsu...@googlegroups.com>
I'm mostly +1, but am -1 on some details of the EL functions:
+<list style="hanging">
+ <t hangText="os:htmlEncode">
+Encode HTML markup entities. At minimum escape greater-than and
less-than symbols and quotation marks to their encoded
equivilents.</t>
Typo, equivilents -> equivalents.
+ <t hangText="os:htmlDecode">
+Unescape an HTML-encoded string
+ </t>
+ <t hangText="os:urlEncode">
+URL-encode the contained string
+ </t>
This isn't specific enough to allow compatible implementation. Are we
encoding a full URL? Or just a parameter? And what character set is
used for encoding?
For example, if we have:
<a href="http://example.com?foo=${os:urlEncode(someExpression)}&debug=1"/>
... then it's essential to encode '&' in someExpression to %26.
But if there's:
<a href="${os:urlEncode(someExpression)}"/>
Then you'd absolutely have to *not* encode '&' to %26.
Context-sensitivity here is undesirable so we either need to pick one
or have two functions (os:urlEncode and os:urlParamEncode). I'd
recommend having just os:urlParamEncode, or if we need both behaviors
then two functions.
Also, the character set matters - should we simply say UTF-8, or
should we use the charset of the generated content?
+ <t hangText="os:urlDecode">
+URL-decode the contained string
+ </t>
+ <t hangText="os:filterUrl">
+Apply rules to make the URL safe for inclusion in markup.
Recommendations are to disallow javascript and apply anti-phishing
mechanisms.
+ </t>
+ <t hangText="os:jsStringEscape">
+Escape string for inclusion within JavaScript block inside quotes.
There is an optional second parameter to specify that the string
should be escaped for inclusion within single quotes when set to true.
Why not just always escape both ' and ", and save the need for the
extra parameter? Boolean parameters are a royal pain - there's no
obvious way to remember whether you use true for ' or for ", so it's
easy to get wrong, and hard to visually audit.
+ <figure>
+ <artwork xml:space="preserve">
+var x = "${os:jsStringEscape(someVar)}";
+var y = '${os:jsStringEscape(someVar, true)}';
+</artwork>
I'm also -0 on the need for "decode" functions; I'm fine with having
them there for symmetry, but don't specifically know of use cases.
Apologies if that's been discussed and I've missed it.
> To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
On Jan 5, 9:30 am, Lev Epshteyn <le...@google.com> wrote:
> Generally like Adam's suggestions. (spefically, I agree we need to encode
> URL params much more often than whole URLs, and that decoding is not
> necessary).
>
> On Sun, Dec 20, 2009 at 9:03 PM, Adam Winer <awi...@gmail.com> wrote:
> > I've been out of town for the past week, and generally busy -
> > apologies for not looking at this.
>
> > I'm mostly +1, but am -1 on some details of the EL functions:
>
> > +<list style="hanging">
> > + <t hangText="os:htmlEncode">
> > +Encode HTML markup entities. At minimum escape greater-than and
> > less-than symbols and quotation marks to their encoded
> > equivilents.</t>
>
> > Typo, equivilents -> equivalents.
>
> > + <t hangText="os:htmlDecode">
> > +Unescape an HTML-encoded string
> > + </t>
> > + <t hangText="os:urlEncode">
> > +URL-encode the contained string
> > + </t>
>
> > This isn't specific enough to allow compatible implementation. Are we
> > encoding a full URL? Or just a parameter? And what character set is
> > used for encoding?
>
> > For example, if we have:
>
> > <a href="http://example.com?foo=${os:urlEncode(someExpression)}&debug=1<http://example.com?foo=$%7Bos:urlEncode%28someExpression%29%7D&debug=1>
> > On Wed, Dec 16, 2009 at 5:13 PM, Tosh Meston <tosh.mes...@gmail.com>
> > >> >> opensocial-and-gadg...@googlegroups.com<opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com><opensocial-and-gad
> > gets-spec%2Bunsu...@googlegroups.com<gets-spec%252Buns...@googlegroups.com>
>
> > >> >> .
> > >> >> For more options, visit this group at
> > >> >>http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > Groups
> > >> > "OpenSocial and Gadgets Specification Discussion" group.
> > >> > To post to this group, send email to
> > >> > opensocial-an...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to
> > >> > opensocial-and-gadg...@googlegroups.com<opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com><opensocial-and-gad
> > gets-spec%2Bunsu...@googlegroups.com<gets-spec%252Buns...@googlegroups.com>
Lane, should I be committing this patch as well?
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
> > <opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com<opensocial-and-gadgets-spec%252Buns...@googlegroups.com>
> > ><opensocial-and-gad
> > > > > > gets-spec%2Bunsu...@googlegroups.com<gets-spec%252Buns...@googlegroups.com>
> > <gets-spec%252Buns...@googlegroups.com<gets-spec%25252Bun...@googlegroups.com>
>
> > > > > > >> >> .
> > > > > > >> >> For more options, visit this group at
>
> >http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
>
> > > > > > >> > --
> > > > > > >> > You received this message because you are subscribed to the
> > Google
> > > > > > Groups
> > > > > > >> > "OpenSocial and Gadgets Specification Discussion" group.
> > > > > > >> > To post to this group, send email to
> > > > > > >> > opensocial-an...@googlegroups.com.
> > > > > > >> > To unsubscribe from this group, send email to
> > > > > > >> > opensocial-and-gadg...@googlegroups.com<opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com>
> > <opensocial-and-gadgets-spec%2Bunsu...@googlegroups.com<opensocial-and-gadgets-spec%252Buns...@googlegroups.com>
> > ><opensocial-and-gad
> > > > > > gets-spec%2Bunsu...@googlegroups.com<gets-spec%252Buns...@googlegroups.com>
> > <gets-spec%252Buns...@googlegroups.com<gets-spec%25252Bun...@googlegroups.com>
>
> ...
>
> read more »