incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/2] Added CDATA to image name and image description, to avoid breaking XML when this fields contains unsupported characters.
Date Thu, 02 Dec 2010 09:52:59 GMT
From: Michal Fojtik <mfojtik@redhat.com>

---
 server/views/images/index.xml.haml |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/server/views/images/index.xml.haml b/server/views/images/index.xml.haml
index 356668b..732769f 100644
--- a/server/views/images/index.xml.haml
+++ b/server/views/images/index.xml.haml
@@ -4,5 +4,9 @@
     %image{:href => image_url(image.id), :id => image.id}
       - image.attributes.select{ |attr| attr!=:id }.each do |attribute|
         - haml_tag("#{attribute}".tr('-', '_'), :<) do
-          - haml_concat image.send(attribute)
+          - if [:name, :description].include?(attribute)
+            =cdata do
+              - haml_concat image.send(attribute)
+          - else
+            - haml_concat image.send(attribute)
 
-- 
1.7.3.2


Mime
View raw message