summaryrefslogtreecommitdiff
path: root/sandbox/com
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2002-09-27 13:34:37 +0000
committerJoachim Lingner <jl@openoffice.org>2002-09-27 13:34:37 +0000
commit2e79f89a9de16a4aae98d1eebc2705764ffedb73 (patch)
tree30f4bb0b24ae5212dd0c2dcba6f392c4ab0b492c /sandbox/com
parent95b727245029c1d256aa5df16a92a730f870b91d (diff)
#101435# file urls containing were not properly handled. SecurityExceptions were thrown when one tried checkRead on such a file.
Diffstat (limited to 'sandbox/com')
-rw-r--r--sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java b/sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java
index 7c11a7d294cc..997550a47ad3 100644
--- a/sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java
+++ b/sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java
@@ -2,9 +2,9 @@
*
* $RCSfile: SandboxSecurity.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jl $ $Date: 2001-11-22 13:55:54 $
+ * last change: $Author: jl $ $Date: 2002-09-27 14:34:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -442,7 +442,10 @@ public class SandboxSecurity extends SecurityManager //implements SecurityManage
if (base.getProtocol().equals("file")) {
String dir = null;
try {
- dir = (new File(base.getFile()).getCanonicalPath());
+ // If the file url contains spaces (i.e. %20) then URL.getFile() still contains %20
+ // File.getCanonicalPath does not replace %20
+ String sWithSpaces= base.getFile().replaceAll("%20"," ");
+ dir = (new File(sWithSpaces).getCanonicalPath());
} catch (IOException e) { // shouldn't happen
throw(new SandboxSecurityException("checkread.exception2", e.toString()));
}