Revision: 1974
Author: [email protected]
Date: Thu Jul 22 11:06:17 2010
Log: Escape '&' character in URL to make it a valid attribute in the DOAP XML


Update Issue 310
Fixed the escaping part
http://code.google.com/p/simal/source/detail?r=1974

Modified:
/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js

=======================================
--- /trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js Mon Jun 21 17:23:59 2010 +++ /trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js Thu Jul 22 11:06:17 2010
@@ -213,6 +213,11 @@
   }
   return fieldValue;
 }
+
+function escapeXML(oldValue) {
+  var re = new RegExp("&+(?!amp;)", "g");
+  return oldValue.replace(re, "&");
+}

 function checkUrl(fieldName) {
   fieldValue = document.getElementById(fieldName).value;
@@ -232,7 +237,7 @@
     }

   }
-  return fieldValue;
+  return escapeXML(fieldValue);
 }

 function generate() {

--
You received this message because you are subscribed to the Google Groups "Simal 
Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simal-commits?hl=en.

Reply via email to