Opened 12 months ago

Closed 11 months ago

Last modified 5 months ago

#6811 closed defect (fixed)

Blank values for snippet arguments are ignored

Reported by: mjethani Assignee: mjethani
Priority: P2 Milestone:
Module: Core Keywords: circumvention
Cc: kzar, rscott, Ross Blocked By:
Blocking: #6538 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29852568/

Description (last modified by mjethani)

Environment

Adblock Plus with Snippets as of changeset b3488684866c

How to reproduce

  1. Write a snippet function foo(one, two, three) { console.log("one=" + one, "two=" + two, "three=" + three); } in the snippets library
  2. Write a snippet filter example.com#$#foo 1 '' 3
  3. Visit http://example.com

Observed behaviour

Prints one=1, two=3, three=undefined

Expected behaviour

Prints one=1, two=, three=3

Additional notes

The parsing code in lib/snippets.js needs to be modified to accept blank values for arguments.

Hints for testers

Try the filter example.com$#$log Hello '' world on example.com. It should print "Hello" followed by "world" to the console, on the same line, but with two spaces between "Hello" and "world".

Change History (10)

comment:1 Changed 12 months ago by mjethani

  • Component changed from Unknown to Core

comment:2 Changed 12 months ago by mjethani

  • Sensitive set

comment:3 Changed 11 months ago by mjethani

  • Owner set to mjethani

comment:4 Changed 11 months ago by mjethani

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

comment:5 Changed 11 months ago by abpbot

A commit referencing this issue has landed:
Issue 6811 - Parse blank arguments to snippets correctly

comment:6 Changed 11 months ago by mjethani

  • Description modified (diff)

comment:7 Changed 11 months ago by mjethani

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

comment:8 Changed 11 months ago by mjethani

  • Cc rscott Ross added

comment:9 Changed 9 months ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed. Blank values are not ignored.

ABP 3.3.2.2175
Firefox 62 / 51 / Windows 10
Chrome 69 / 49 / Windows 10
Opera 56 / 36 / Windows 10

comment:10 Changed 5 months ago by mjethani

  • Sensitive unset
Note: See TracTickets for help on using tickets.