Author: ate
Date: Wed May 13 17:08:15 2009
New Revision: 774437
URL: http://svn.apache.org/viewvc?rev=774437&view=rev
Log:
JS2-1011: NavigationalState Base64 encoding needs to escape '+' characters
See: https://issues.apache.org/jira/browse/JS2-1011
Modified:
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
Modified:
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java?rev=774437&r1=774436&r2=774437&view=diff
==============================================================================
---
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
(original)
+++
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
Wed May 13 17:08:15 2009
@@ -767,7 +767,7 @@
* Decodes a Base64 encoded string.
*
* Because the encoded string is used in an URL
- * the two '/' and '=' which has some significance in an URL
+ * the three '+', '/' and '=' which has some significance in an URL
* are encoded on top of the Base64 encoding and are first translated back
before decoding.
*
* @param value
@@ -777,7 +777,7 @@
protected String decodeParameters(String value, String characterEncoding)
throws UnsupportedEncodingException
{
- value = value.replace('-','/').replace('_','=');
+ value = value.replace('-','/').replace('_','=').replace('.','+');
if ( characterEncoding != null )
{
return new
String(Base64.decodeBase64(value.getBytes(characterEncoding)),
characterEncoding);
@@ -792,7 +792,7 @@
* Encodes a string with Base64.
*
* Because the encoded string is used in an URL
- * the two '/' and '=' which has some significance in an URL
+ * the three '+', '/' and '=' which has some significance in an URL
* are encoded on top of/after the Base64 encoding
*
* @param value
@@ -809,7 +809,7 @@
{
value = new String(Base64.encodeBase64(value.getBytes()));
}
- return value.replace('/','-').replace('=','_');
+ return value.replace('/','-').replace('=','_').replace('+','.');
}
protected String encodeArgument( String argument, char terminator )
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]