Fix bug where http:// is not being added if there is a "http://" already in the query string.

This commit is contained in:
Gunther Brunner
2015-03-04 21:22:43 +09:00
parent cd86fc8033
commit 958a3bcfb9

View File

@@ -26,7 +26,9 @@ module.exports = function NavigationCtrl($scope, $rootScope) {
function addHttp(textUrl) {
// Check for '://' because a protocol-less URL might include
// a username:password combination.
return (textUrl.indexOf('://') === -1 ? 'http://' : '') + textUrl
// Ignores also any query parameter because it may contain a http:// inside.
return (textUrl.replace(/\?.*/, '').indexOf('://') === -1 ? 'http://' : ''
) + textUrl
}
$scope.blurUrl = false