Changeset 3178


Ignore:
Timestamp:
2002-06-25T11:45:14+12:00 (22 years ago)
Author:
kjdon
Message:

fixed an obscure IE bug - it was adding a port number of -1 to the url

  • in tidy_URL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/java/org/nzdl/gsdl/Phind/Phind.java

    r2789 r3178  
    492492    String tidy_URL(String address, boolean isCGI) {
    493493
    494     // System.out.println("tidy URL: " + address);
     494    // System.err.println("tidy URL: " + address);
    495495   
    496496    // make sure the URL has protocol, host, and file
     
    500500        // there is not protocol and host
    501501        URL document = getDocumentBase();
    502         address = "http://" + document.getHost() + ":" + document.getPort() + address;
     502        String port = "";
     503        if (document.getPort()!=-1) {
     504        port = ":" + document.getPort();
     505        }
     506        address = "http://" + document.getHost() + port  + address;
    503507    } else {
    504508        // this URL is relative to the directory the document is in
     
    506510        String directory = document.getFile();
    507511        int end = directory.lastIndexOf('/');
     512        String port = "";
     513        if (document.getPort()!=-1) {
     514        port = ":" + document.getPort();
     515        }
    508516        directory = directory.substring(0,end + 1);
    509         address = "http://" + document.getHost() + ":" + document.getPort() + directory + address;
     517        address = "http://" + document.getHost() + port + directory + address;
    510518
    511519    }
Note: See TracChangeset for help on using the changeset viewer.