Patches: Browse | Submit New | Admin

[#15610] EscapeRuby in 2.4.1 engine generates bad code for certain expressions

Date:
2007-11-13 20:25
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
EscapeRuby in 2.4.1 engine generates bad code for certain expressions

Detailed description
<%= "hello" if true %>
is converted to:
Erubis::XmlHelper.escape_xml( "hello" if true )
which is an invalid expression.

Wrapping the code block in params fixes this issue. Not sure if it applies generaly however.


--- lib/erubis/engine/eruby.rb.bak      2007-11-13 13:03:03.000000000 -0700
+++ lib/erubis/engine/eruby.rb  2007-11-13 13:20:41.000000000 -0700
@@ -33,7 +33,7 @@
     end
                                                                                     def escaped_expr(code)
-      return "#{@escapefunc}(#{code})"
+      return "#{@escapefunc}((#{code}))"
     end                                                                         
     #--

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item