Skip to content

Commit

Permalink
Add value check for nodeText function (bugsnag#184)
Browse files Browse the repository at this point in the history
* Add value check for nodeText function

This will make it easer to follow breadcrumbs for events that happened on submit buttons ect.

* Add password security check to nodeText function
  • Loading branch information
Anton Pawlik authored and eanakashima committed Sep 23, 2016
1 parent d43dbd6 commit 8efe06f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bugsnag.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,10 @@

// extract text content from a element
function nodeText(el) {
var text = el.textContent || el.innerText || "";
if (el.getAttribute('type') === 'password') {
return 'Password value can not be shown or it is empty';
}
var text = el.textContent || el.innerText || el.value || "";
text = text.replace(/^\s+|\s+$/g, ""); // trim whitespace
return truncate(text, 140);
}
Expand Down

0 comments on commit 8efe06f

Please sign in to comment.