From 1eb5a99ba331f1e1508100ac00e53aae204f81a0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 18 Oct 2017 15:54:42 -0400 Subject: [PATCH] make sure uri has `.` in it before prefixing http --- src/app/services/cipherService.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/services/cipherService.js b/src/app/services/cipherService.js index 325052ac95..264a5a06ce 100644 --- a/src/app/services/cipherService.js +++ b/src/app/services/cipherService.js @@ -197,13 +197,12 @@ angular else if (hostnameUri.indexOf('iosapp://') === 0) { cipher.icon = 'fa-apple'; } - else if (hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('http://') !== 0 && - hostnameUri.indexOf('https://') !== 0) { + else if (hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) { hostnameUri = "http://" + hostnameUri; isWebsite = true; } else { - isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > 0; + isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1; } if (setImage && isWebsite) {