Clojure

clojure.xml emit does not properly escape attribute and element content

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None

Description

(with-out-str
  (clojure.xml/emit-element {:tag :e :attrs nil :content "&"}))
</code></pre>
produces: <e>&</e>
correct would be: <e>&amp;</e>
This is true for both element content and attribute content. < and > are not escaped as well. Furthermore, apostrophe ( ' ) in an attribute value leads to broken xml:
<pre><code>
<e a='''/>

Activity

Stuart Halloway made changes -
Field Original Value New Value
Status In Progress [ 3 ] Resolved [ 5 ]
Assignee Rich Hickey [ richhickey ]
Approval Test None
Resolution Declined [ 2 ]
Stuart Halloway made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: