Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default value of validateWCAG2Parms #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waitingcheung
Copy link

The function validateWCAG2Parms returns {"level":"AA", "size":"small"} for invalid parms. Since it is calling toUpperCase for level and toLowerCase for size, if either parms.level or parms.size is not of type string but evaluates to true, it will cause the following hard crash.

    size = (parms.size || "small").toLowerCase();
                                   ^

TypeError: (parms.size || "small").toLowerCase is not a function
    at validateWCAG2Parms (/path/tinycolor.js:1172:36)
    at Function.tinycolor.isReadable (/path/tinycolor.js:748:18)
    at Function.tinycolor.mostReadable (/path/tinycolor.js:792:19)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant