mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-25 00:30:29 +00:00
Merge branch 'master' of https://github.com/pi-hole/pi-hole into v5.3
This commit is contained in:
commit
9ecd4c6e9e
4 changed files with 46 additions and 22 deletions
|
@ -584,10 +584,15 @@ SetWebUITheme() {
|
|||
}
|
||||
|
||||
CheckUrl(){
|
||||
local regex
|
||||
local regex check_url
|
||||
# Check for characters NOT allowed in URLs
|
||||
regex="[^a-zA-Z0-9:/?&%=~._-]"
|
||||
if [[ "${1}" =~ ${regex} ]]; then
|
||||
regex="[^a-zA-Z0-9:/?&%=~._()-;]"
|
||||
|
||||
# this will remove first @ that is after schema and before domain
|
||||
# \1 is optional schema, \2 is userinfo
|
||||
check_url="$( sed -re 's#([^:/]*://)?([^/]+)@#\1\2#' <<< "$1" )"
|
||||
|
||||
if [[ "${check_url}" =~ ${regex} ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue