mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Merge pull request #1734 from pi-hole/fix/query-options
Fix query option handling
This commit is contained in:
commit
3a3c0befa7
5
pihole
5
pihole
@ -85,7 +85,8 @@ updateGravityFunc() {
|
|||||||
|
|
||||||
# Scan an array of files for matching strings
|
# Scan an array of files for matching strings
|
||||||
scanList(){
|
scanList(){
|
||||||
local domain="${1}" lists="${2}" type="${3:-}"
|
# Escape full stops
|
||||||
|
local domain="${1//./\\.}" lists="${2}" type="${3:-}"
|
||||||
|
|
||||||
# Prevent grep from printing file path
|
# Prevent grep from printing file path
|
||||||
cd "/etc/pihole" || exit 1
|
cd "/etc/pihole" || exit 1
|
||||||
@ -154,7 +155,7 @@ Options:
|
|||||||
|
|
||||||
# Strip valid options, leaving only the domain and invalid options
|
# Strip valid options, leaving only the domain and invalid options
|
||||||
# This allows users to place the options before or after the domain
|
# This allows users to place the options before or after the domain
|
||||||
options=$(sed -E 's/ ?-(bp|adlists?|all|exact)//g' <<< "${options}")
|
options=$(sed -E 's/ ?-(bp|adlists?|all|exact) ?//g' <<< "${options}")
|
||||||
|
|
||||||
# Handle remaining options
|
# Handle remaining options
|
||||||
# If $options contain non ASCII characters, convert to punycode
|
# If $options contain non ASCII characters, convert to punycode
|
||||||
|
Loading…
Reference in New Issue
Block a user