plainblack.com
Username Password
search
Bookmark and Share

    

AssetId may break html comments

User rogier
Date 10/15/2009 4:18 am
Views 716
Rating 0    Rate [
|
]
Previous · Next
User Message
rogier

At the WUC, I was told that an assetId in an HTML comment may break the comment if the assetId contains two or more subsequent dashes. (Or are they called hyphens?) This will cause the full comment to render on the page.

In the new default templates we use this frequently, at least once per template, like so:

<!-- /article<tmpl_var assetId> -->

I can think of a couple of solutions:

  1. don't use assetIds in comments
  2. add a "safe" assetId, in which dashes are replaced by something that will work in comments and still leave the assetId to be unique, like #
  3. we fix this in WG8, using Template Toolkit

 

I assume that with TT, something like this is possible:

[% assetId FILTER safeForComment %]

But I don't think we want to use TT, if we can find a solution in the backend. So I would prefer option 2.


Any thoughts?

 

Rogier | United Knowledge
www.unitedknowledge.nl · www.webgui-help.nl



Back to Top
Rate [
|
]
 
 
perlDreamer

There's a bug open for this, assigned to tabb.

http://www.webgui.org/use/bugs/tracker/10932


Although, if it's a change that has to be made to every single template, once she/y'all arrive at a solution, it makes more sense to throw it back to a developer to do it, since we can script solutions to alter the templates.



Back to Top
Rate [
|
]
 
 
rogier

There's a bug open for this, assigned to tabb.

http://www.webgui.org/use/bugs/tracker/10932

Although, if it's a change that has to be made to every single template, once she/y'all arrive at a solution, it makes more sense to throw it back to a developer to do it, since we can script solutions to alter the templates.

OK, I'll keep that in mind.

Rogier | United Knowledge
www.unitedknowledge.nl · www.webgui-help.nl



Back to Top
Rate [
|
]
 
 
perlDreamer

Is using a different format for the assetId acceptable?  assetId are normally in a slightly modified base64 format.  If we were to use hexadecimal, the assetId is longer, but only uses alphanumerics, so there would be no problems in the comments.



Back to Top
Rate [
|
]
 
 
arjan

longer, but only uses alphanumerics, so there would be no problems in the comments.

I think it's a very good idea only to use alphanumerics.

Kind regards,

Arjan Widlak

United Knowledge
Internet for the public sector

www.unitedknowledge.nl



Back to Top
Rate [
|
]
 
 
© 2012 Plain Black Corporation | All Rights Reserved