Project

Profile

Help

Revision e2082716

Added by Norman Tovey-Walsh over 1 year ago

Port fix for bug #4745 to 9.9

View differences:

latest9.9/hej/net/sf/saxon/om/DocumentURI.java
8 8
package net.sf.saxon.om;
9 9

  
10 10
import java.io.File;
11
import java.io.IOException;
11 12

  
12 13
/**
13 14
 * This class encapsulates a string used as the value of the document-uri() property of a document,
......
73 74
            if (uri.startsWith("file:///")) {
74 75
                uri = "file:/" + uri.substring(8);
75 76
            }
77
            if (uri.startsWith("file:/")) {
78
                // Use getCanonicalPath() to remove any "." and ".." path segments
79
                try {
80
                    String cpath = new File(uri.substring(5)).getCanonicalPath();
81
                    uri = "file:" + cpath;
82
                } catch (IOException ioe) {
83
                    // nop
84
                }
85
            }
76 86
            if (CASE_BLIND_FILES) {
77 87
                uri = uri.toLowerCase();
78 88
            }

Also available in: Unified diff