Skip to main content

Bug Tracker

Side navigation

#13167 closed bug (notabug)

Opened January 07, 2013 12:17PM UTC

Closed January 11, 2013 02:48PM UTC

jQuery tries to evaluate some CSS classes instead of using as string

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:
Description

Words such as Естетика are converted to something like .%d0%b5%d1%81%d1%82%d0%b5%d1%82%d0%b8%d0%ba%d0%b0 (CSS class) using popular sanitizers (if you'll use this as WordPress category, it will create such slug/nicename for that category which is supposed to be safe, English version to use in various places in the code).

Although it seems like a valid class name jQuery tries to evaluate that instead of using as a string.

Attachments (0)
Change History (4)

Changed January 07, 2013 01:52PM UTC by dmethvin comment:1

owner: → anonymous
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed January 11, 2013 01:28PM UTC by anonymous comment:2

status: pendingnew

Changed January 11, 2013 01:31PM UTC by anonymous comment:3

Replying to [comment:2 anonymous]:

http://jsfiddle.net/FrKyN/

Correct link: http://jsfiddle.net/FrKyN/526/

Changed January 11, 2013 02:48PM UTC by dmethvin comment:4

_comment0: It's not being executed, it's being rejected as an invalid selector. Here is your selector, it appears to be escaped using URL encoding rules: \ \ > `'.%d0%b5%d1%81%d1%82%d0%b5%d1%82%d0%b8%d0%ba%d0%b0'` \ \ Here are the CSS selector escaping rules: \ \ http://www.w3.org/TR/CSS21/syndata.html#characters \ \ You'll need to escape the selector properly. \ 1357915970324582
resolution: → notabug
status: newclosed

It's not being executed, it's being rejected as an invalid selector. Here is your selector, it appears to be escaped using URL encoding rules:

'.%d0%b5%d1%81%d1%82%d0%b5%d1%82%d0%b8%d0%ba%d0%b0'

Here are the CSS selector escaping rules:

http://www.w3.org/TR/CSS21/syndata.html#characters

You'll need to escape the selector properly.

**EDIT:** Note that since you're writing a JavaScript string, you need to double up the backslashes.