@@ -623,7 +623,11 @@ function createResults(resultsPath) {
623623 srLink . innerHTML = elem [ 1 ] [ 0 ] ;
624624 srEntry . appendChild ( srLink ) ;
625625 if ( elem [ 1 ] . length == 2 ) { // single result
626- srLink . setAttribute ( 'href' , resultsPath + elem [ 1 ] [ 1 ] [ 0 ] ) ;
626+ if ( elem [ 1 ] [ 1 ] [ 0 ] . startsWith ( 'http://' ) || elem [ 1 ] [ 1 ] [ 0 ] . startsWith ( 'https://' ) ) { // absolute path
627+ srLink . setAttribute ( 'href' , elem [ 1 ] [ 1 ] [ 0 ] ) ;
628+ } else { // relative path
629+ srLink . setAttribute ( 'href' , resultsPath + elem [ 1 ] [ 1 ] [ 0 ] ) ;
630+ }
627631 srLink . setAttribute ( 'onclick' , 'searchBox.CloseResultsWindow()' ) ;
628632 if ( elem [ 1 ] [ 1 ] [ 1 ] ) {
629633 srLink . setAttribute ( 'target' , '_parent' ) ;
@@ -643,7 +647,11 @@ function createResults(resultsPath) {
643647 srChild . setAttribute ( 'id' , 'Item' + index + '_c' + c ) ;
644648 setKeyActions ( srChild , 'return searchResults.NavChild(event,' + index + ',' + c + ')' ) ;
645649 setClassAttr ( srChild , 'SRScope' ) ;
646- srChild . setAttribute ( 'href' , resultsPath + elem [ 1 ] [ c + 1 ] [ 0 ] ) ;
650+ if ( elem [ 1 ] [ c + 1 ] [ 0 ] . startsWith ( 'http://' ) || elem [ 1 ] [ c + 1 ] [ 0 ] . startsWith ( 'https://' ) ) { // absolute path
651+ srLink . setAttribute ( 'href' , elem [ 1 ] [ c + 1 ] [ 0 ] ) ;
652+ } else { // relative path
653+ srLink . setAttribute ( 'href' , resultsPath + elem [ 1 ] [ c + 1 ] [ 0 ] ) ;
654+ }
647655 srChild . setAttribute ( 'onclick' , 'searchBox.CloseResultsWindow()' ) ;
648656 if ( elem [ 1 ] [ c + 1 ] [ 1 ] ) {
649657 srChild . setAttribute ( 'target' , '_parent' ) ;
0 commit comments