summaryrefslogtreecommitdiff
path: root/www/js/DataModel.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-08-10 15:11:05 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-08-10 15:11:05 -0400
commitf690e6deb88909a7b7d7b9bec2d20bcac857d8e3 (patch)
tree602c433232753f21cee2c68b2e4bb6023090bdc5 /www/js/DataModel.js
parent668e6b0e0761e4d5398b6e37d8f0e00e88791eb0 (diff)
#293 regexp tweaks
Former-commit-id: a6dfc81af4846def3db110a909a80685ccb2b1d9
Diffstat (limited to 'www/js/DataModel.js')
-rw-r--r--www/js/DataModel.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index a2ef3647..72d4fc27 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -139,13 +139,31 @@ angular.module('zmApp.controllers')
//--------------------------------------------------------------------------
// uses fileLogger to write logs to file for later investigation
//--------------------------------------------------------------------------
+
+ // separate out a debug so we don't do this if comparison for normal logs
+ function zmDebug(val) {
+ if (loginData.enableDebug && loginData.enableLogs)
+ {
+ if (val!== undefined)
+ {
+ var regex1 = /"password":".*?"/g;
+ var regex2 = /&pass=.*?(?=["&]|$)/g;
+
+ //console.log ("VAL IS " + val);
+ val = val.replace(regex1, "<password removed>");
+ val = val.replace(regex2, "<password removed>");
+ }
+ $fileLogger.debug(val);
+ }
+ }
+
function zmLog(val, logtype) {
if (loginData.enableLogs)
{
if (val!== undefined)
{
var regex1 = /"password":".*?"/g;
- var regex2 = /&pass=.*?&/g;
+ var regex2 = /&pass=.*?(?=["&]|$)/g;
//console.log ("VAL IS " + val);
val = val.replace(regex1, "<password removed>");
@@ -183,20 +201,7 @@ angular.module('zmApp.controllers')
}
- // separate out a debug so we don't do this if comparison for normal logs
- function zmDebug(val) {
- if (loginData.enableDebug && loginData.enableLogs)
- {
- if (val!== undefined)
- {
- var regex = /"password":".*?"/g;
-
- //console.log ("VAL IS " + val);
- val = val.replace(regex, "<password removed>");
- }
- $fileLogger.debug(val);
- }
- }
+
//credit: https://gist.github.com/alexey-bass/1115557
function versionCompare(left, right) {