Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use backslash(\) instead of slash(/) to escape quotes in the client name #3201

Closed
Jinsung-L opened this issue May 28, 2021 · 1 comment
Closed
Assignees
Milestone

Comments

@Jinsung-L
Copy link

const baseRule = `||${domain}^$client='${client.replace(/'/g, '/\'')}'`;

According to the documentation, it says

If the client name contains quotes, use \ to escape them.

https://github.com/AdguardTeam/AdGuardHome/wiki/Hosts-Blocklists#client

So the code should be

const baseRule = `||${domain}^$client='${client.replace(/'/g, '\\\'')}'`; 
@ameshkov ameshkov added this to the v0.107.0 milestone May 29, 2021
@ameshkov
Copy link
Member

Oh, thanks for noticing this!

@ameshkov ameshkov added the UI label May 29, 2021
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Closes AdguardTeam#3201

Squashed commit of the following:

commit 43d2b96
Merge: 36eeb1b 784bc31
Author: Ildar Kamalov <ik@adguard.com>
Date:   Mon Aug 16 17:29:06 2021 +0300

    Merge branch 'master' into 3201-escape-quotes

commit 36eeb1b
Author: Ildar Kamalov <ik@adguard.com>
Date:   Mon Aug 16 15:56:15 2021 +0300

    client: multiple escape

commit e7c19dd
Author: Ildar Kamalov <ik@adguard.com>
Date:   Mon Aug 16 12:04:43 2021 +0300

    client: use backslash to escape quotes in the client name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants