Author: ssanthor
Date: 2007-03-26 15:31:57 +0200 (Mon, 26 Mar 2007)
New Revision: 4654
Modified:
branches/2.10/core-api/src/main/java/no/schibstedsok/searchportal/result/Linkpulse.java
Log:
fix for SEARCH-1861 all non "ext" linkpuls tags should now be provided with a
absolute url (which will include the "search/")
Modified:
branches/2.10/core-api/src/main/java/no/schibstedsok/searchportal/result/Linkpulse.java
===================================================================
---
branches/2.10/core-api/src/main/java/no/schibstedsok/searchportal/result/Linkpulse.java
2007-03-26 13:15:38 UTC (rev 4653)
+++
branches/2.10/core-api/src/main/java/no/schibstedsok/searchportal/result/Linkpulse.java
2007-03-26 13:31:57 UTC (rev 4654)
@@ -65,13 +65,18 @@
}
}
//adds to-url, if to-url links to external site we must drop site
name prefix
+ // remove last slash to avoid doubble slashes orgUrl should alwais
start with slash
+ String siteName = site.getName();
+ if(siteName.endsWith("/")){
+ siteName = siteName.substring(0,siteName.length() -1);
+ }
toUrl.append( indexpage.equalsIgnoreCase("ext")
? '/' + orgUrl
- : "/http://" + site.getName() + "search/" + orgUrl);
+ : "/http://" + siteName + orgUrl);
} else{
toUrl.append( Boolean.valueOf(indexpage)
- ? "search/" + orgUrl
+ ? "" + orgUrl
: orgUrl);
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits