Opened on 11/05/2014 at 02:15:35 PM

Closed on 11/10/2014 at 02:26:19 PM

#1527 closed defect (fixed)

Generated CSS selectors aren't always correctly escaped

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-1.8.8-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/4935175632846848

Description (last modified by sebastian)

Background

Some of the element hiding filters generated by the "Block element" dialog use improperly escaped CSS selectors, breaking those filters, or element hiding all together when those filters are used.

What to change

Properly escape CSS selectors when generating element hiding filters, considering following rules:

  • Non-alphanumeric ASCII characters, except for the - (dash) and _ (underscore), must be escaped everywhere in an id or class.
  • Digits must be escaped when in the first place of an id or class.
  • Dashes (-) must be escaped when in the first place of an id or class, and not followed by a character which isn't another dash or digit.
  • Colons (:) must be escaped in tag names (other characters that would need escaping can not occur in a tag name).
  • Quoted attribute values must still escape \r (carriage return), \n (new line), \f (new page) and \0 (null).
  • Control characters and digits must be escaped based on their code point (e.g. \n -> \0a ). Other characters can be escaped by prepending a \ (backslash).

Attachments (0)

Change History (5)

comment:1 Changed on 11/05/2014 at 02:16:35 PM by sebastian

  • Description modified (diff)

comment:2 Changed on 11/05/2014 at 02:17:41 PM by sebastian

  • Description modified (diff)

comment:3 Changed on 11/05/2014 at 02:19:29 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed on 11/06/2014 at 04:09:13 PM by sebastian

  • Description modified (diff)

comment:5 Changed on 11/10/2014 at 02:26:19 PM by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.