dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04396
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1456: Improved html encoding, thanks to Viet
------------------------------------------------------------
revno: 1456
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-02-19 20:20:28 +0100
message:
Improved html encoding, thanks to Viet
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js 2010-02-17 13:38:15 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js 2010-02-19 19:20:28 +0000
@@ -244,12 +244,12 @@
*/
function htmlEncode( str )
{
+ str = str.replace( /\%/g, "%25" ); //This line must come first so the % doesn't get overwritten later
str = str.replace( /\ /g, "%20" );
str = str.replace( /\!/g, "%21" );
str = str.replace( /\"/g, "%22" );
str = str.replace( /\#/g, "%23" );
str = str.replace( /\$/g, "%24" );
- str = str.replace( /\%/g, "%25" );
str = str.replace( /\&/g, "%26" );
str = str.replace( /\'/g, "%27" );
str = str.replace( /\(/g, "%28" );