Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

" in variable names causing javascript error in debug o

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
cybot
Smarty Regular


Joined: 20 Apr 2005
Posts: 83

PostPosted: Thu Oct 26, 2006 2:12 pm    Post subject: " in variable names causing javascript error in debug o Reply with quote

" in variable names is not escaped in JavaScript commands

reproduce:
Code:
$smarty->assign('"0"', 0);


let smarty open debug window ({debug} in template or any other way)

JavaScript error:
Code:
missing ) after argument list
_smarty_console.document.write("<tr bgcolor=#fafafa><td valign=top><tt><font color=blue>{$"0"}</font></tt></td><td nowrap><tt><font color=green>&quot;0&quot;</font></tt></td></tr>");
Back to top
View user's profile Send private message
cybot
Smarty Regular


Joined: 20 Apr 2005
Posts: 83

PostPosted: Thu Nov 02, 2006 2:45 pm    Post subject: Reply with quote

patch is here:

http://sebastianmendel.de/smarty/libs_debug.tpl_fixed_javascript_escaping.patch.txt
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Nov 02, 2006 7:52 pm    Post subject: Reply with quote

@cybot: This doesn't seem to fix anything for me.
Back to top
View user's profile Send private message
cybot
Smarty Regular


Joined: 20 Apr 2005
Posts: 83

PostPosted: Mon Nov 06, 2006 1:27 pm    Post subject: Reply with quote

doing

Code:
$smarty->assign('"0"', 0);


without the patch gives me a JavaScript error, patched this error is gone when printing the debug console

@boots: you still get the JavaScript error mentioned above with the patch?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Nov 06, 2006 6:41 pm    Post subject: Reply with quote

I didn't try that. I tried your patch on one of my sites that uses JS heavily (including generated JS). Turning on debugging (with or without the patch) breaks the site (never-mind the debugger). I suppose you weren't trying to patch *my* problem Wink
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Nov 07, 2006 8:58 pm    Post subject: Reply with quote

I have applied http://www.phpinsider.com/smarty-forum/viewtopic.php?t=7178 (with some modifications) to CVS. This should also address the issue of this topic.
Back to top
View user's profile Send private message
cybot
Smarty Regular


Joined: 20 Apr 2005
Posts: 83

PostPosted: Wed Nov 08, 2006 7:00 am    Post subject: Reply with quote

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP