i don't think i'd see that as a bug...i think the function exists to
safely format content being passed to a JS function.  this, it does.

i'm sure i'll be corrected if i'm wrong...but i don't think
'</script>' as a string is often passed as an argument to a function. 
I would say that escaping that string would be beyond the defined
scope of the jsStringFormat() function, and therefore not in and of
itself, a bug.


On Wed, 9 Feb 2005 14:43:45 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> Works a treat as long as the string doesn't contain the value
> "</script>" in it anywhere... which essentially means that while
> jsstringformat is great for most applications, it's not bulletproof
> (has a bug). If you need to bulletproof it, you have to add the
> replacement of / with \/, i.e.
> replace(jsstringformat(mystring),"/","\/","ALL"); I put this in a
> function myself -- and I _think_ I submitted it to cflib.org as
> jsformat()
> 
> function jsformat(str) { return
> replace(jsstringformat(str),"/","\/","ALL"); }
> 
> just fyi
> 
> > jsStringFormat()
> 
> > On Wed, 09 Feb 2005 11:02:30 -0400, G. Brown
> > <[EMAIL PROTECTED]> wrote:
> >> Simple question...
> >>
> >> Is there an easy way to escape strings passed to
> >> javascript in Cold Fusion, aside from using the replace
> >> function?
> >>
> >> whateverFunc('#myvar#');
> >>
> >> Just curious.
> >> Thanks
> >> G-
> 
> s. isaac dealey   954.927.5117
> new epoch : isn't it time for a change?
> 
> add features without fixtures with
> the onTap open source framework
> 
> http://macromedia.breezecentral.com/p49777853/
> http://www.sys-con.com/story/?storyid=44477&DE=1
> http://www.sys-con.com/story/?storyid=45569&DE=1
> http://www.fusiontap.com
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193930
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to