Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#5325 closed change (fixed)

[abp2blocklist] Add proper support for separator characters

Reported by: mjethani Assignee: mjethani
Priority: P4 Milestone:
Module: Platform Keywords: abp2blocklist, Acceptable Ads
Cc: kzar, sebastian, mario Blocked By:
Blocking: #5464 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29467595/

Description (last modified by mjethani)

Background

Currently abp2blocklist will convert example.co^ into example\.co and example.co^hello into example\.co.hello. This will match example.co as well as example.com, which is wrong. Based on the filters documentation, the correct patterns to generate are example\.co([^-_.%A-Za-z0-9].*)?$ and example\.co[^-_.%A-Za-z0-9]hello respectively.

What to change

Modify the parseFilterRegexpSource function to generate the correct pattern.

Change History (12)

comment:1 Changed 5 months ago by mjethani

  • Description modified (diff)

comment:2 Changed 5 months ago by mjethani

  • Cc kzar sebastian mario added

comment:3 Changed 5 months ago by mjethani

  • Description modified (diff)

comment:4 Changed 5 months ago by kzar

I think those regexp examples might be wrong, doesn't the . need to be escaped? E.g. example\.co([^\.%A-Za-z0-9_].*)?$

comment:5 Changed 5 months ago by mjethani

The . must not be escaped inside square brackets.

comment:6 Changed 5 months ago by mjethani

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

comment:7 Changed 5 months ago by mjethani

  • Description modified (diff)

I found that we can deal with the - after all. I've updated the description accordingly.

comment:8 Changed 5 months ago by mjethani

  • Description modified (diff)

comment:9 Changed 5 months ago by kzar

  • Priority changed from Unknown to P4
  • Ready set

comment:10 Changed 4 months ago by abpbot

A commit referencing this issue has landed:
Issue 5325 - Add support for separator characters

comment:11 Changed 4 months ago by mjethani

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:12 Changed 4 months ago by mjethani

  • Blocking 5464 added
Note: See TracTickets for help on using tickets.