liflab / cornipickle

Versatile web application testing tool
4 stars 3 forks source link

Hyphen (-) in css selectors causes problems #12

Closed Faterou closed 7 years ago

Faterou commented 9 years ago

Originally reported by: Gabrielle Bastien (Bitbucket: gabrielle_bastien, GitHub: Unknown)


Even after adding the hyphen symbol to the css selector string in the bnf grammar, using an id or a class name containing a hyphen prevents the server from working properly. The element with the id or class name containing a hyphen seems to not be included in the JsonMap of the elements to be verified.


Faterou commented 7 years ago

Original comment by Francis Guérin (Bitbucket: Faterou, GitHub: Faterou):


I think I fixed it by changing the regex string in the probe and in CssSelector.java from "([\w\d]+){0,1}(\.([\w\d]+)){0,1}(#([\w\d]+)){0,1}" to "([\w\d]+){0,1}(\.([\w\d-]+)){0,1}(#([\w\d-]+)){0,1}".

It fixed a problem I had but I don't know if it broke anything else...