From cb4df3a72c2cf8e9d80b6f64b62fe31bdef033a7 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sun, 13 Dec 2015 21:43:29 +0000 Subject: [PATCH] Validate beef.net.connection.type value --- core/main/client/net/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/main/client/net/connection.js b/core/main/client/net/connection.js index 1561a982f..244ce268d 100644 --- a/core/main/client/net/connection.js +++ b/core/main/client/net/connection.js @@ -18,7 +18,7 @@ beef.net.connection = { try { var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection; var type = connection.type; - if (type) return type; else return 'unknown'; + if (/^[a-z]+$/.test(type)) return type; else return 'unknown'; } catch(e) { beef.debug("Error retrieving connection type: " + e.message); return 'unknown';