Skip to content

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.

1 participant