This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
[ABSETUP-538] Adds cleanInput method which URI Encodes <
by default
#1856
Merged
swilliamset
merged 12 commits into
ExactTarget:master
from
cmcculloh-kr:GH1841---xss-when-pasting-script-into-pillbox-control_or_fuelux
Aug 22, 2016
Merged
[ABSETUP-538] Adds cleanInput method which URI Encodes <
by default
#1856
swilliamset
merged 12 commits into
ExactTarget:master
from
cmcculloh-kr:GH1841---xss-when-pasting-script-into-pillbox-control_or_fuelux
Aug 22, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… be overwritten if necessary
…emplate bug requiring value in template data
var isDeleteKey = function isDeleteKey(e) { return e.keyCode === 46; }; | ||
var isTabKey = function isTabKey(e) { return e.keyCode === 9; }; | ||
var isUpArrow = function isUpArrow(e) { return e.keyCode === 38; }; | ||
var isDownArrow = function isDownArrow(e) { return e.keyCode === 40; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move keyCode numbers all to constants.
Dry is*Key methods like so:
var isKeyCode = function isKey(e, specificKey) {
return e.keyCode === specificKey;
}
.
.
.
if (isKeyCode(e, SPECIFIC_KEYCODE)) {
.
.
.
}
if (this.acceptKeyCodes[e.keyCode]) { | ||
// If we test for keycode only, it will match for `<` & `,` instead of just `,` | ||
// This way users can type `<3` and `1 < 3`, etc... | ||
if (this.acceptKeyCodes[e.keyCode] && !isShiftHeld(e)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting! that's why it was catching <
TODO: For consideration: |
@@ -53,18 +38,25 @@ | |||
var TAB_KEYCODE = 9; | |||
var UP_ARROW_KEYCODE = 38; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move up the const object and use it in the is*Key block.
$.fn.utilities = {
CONST: CONST,
TODO: |
cmcculloh-kr
deleted the
GH1841---xss-when-pasting-script-into-pillbox-control_or_fuelux
branch
September 14, 2016 21:05
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue #1841
Fixes JIRA issue ABSETUP-538 & FUELUX-238
Adds cleanInput method which URI Encodes
<
by default, but can be overwritten if necessary.Also relates to #1692 in that it incorporates the hbs template for pillbox into the index.html page.
Adds eslint to file to conform to our dev standards and makes pillbox.js conform to eslint standards.