mirror of
https://github.com/YunoHost-Apps/flohmarkt_ynh.git
synced 2024-09-03 18:36:30 +02:00
repair getting rid of warnings
This commit is contained in:
parent
e9f1a5f245
commit
e45aa5de8a
1 changed files with 15 additions and 8 deletions
|
@ -429,6 +429,9 @@ flohmarkt_ynh_local_curl() {
|
||||||
ynh_die --message="method $method not supported by flohmarkt_ynh_local_curl"
|
ynh_die --message="method $method not supported by flohmarkt_ynh_local_curl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# linter doesn't want that the internal function is used anymore
|
||||||
|
# it's replaced here quick and dirty
|
||||||
|
flohmarkt_normalize_url_path() {
|
||||||
# check that $location is a valid '/path'
|
# check that $location is a valid '/path'
|
||||||
if [[ -n "${location}" ]]; then
|
if [[ -n "${location}" ]]; then
|
||||||
if [ "${location:0:1}" != "/" ]; then
|
if [ "${location:0:1}" != "/" ]; then
|
||||||
|
@ -438,18 +441,22 @@ flohmarkt_ynh_local_curl() {
|
||||||
location="${location:0:${#location}-1}"
|
location="${location:0:${#location}-1}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Define url of page to curl
|
# Define url of page to curl
|
||||||
# $location contains either an URL or just a page
|
# $location contains either an URL or just a page
|
||||||
local full_page_url
|
local full_page_url
|
||||||
|
echo "################### location='$location' ###################"
|
||||||
if [[ "$location" =~ ^https?:// ]]; then
|
if [[ "$location" =~ ^https?:// ]]; then
|
||||||
# if $location starts with an http-protocol use value as a complete URL
|
# if $location starts with an http-protocol use value as a complete URL
|
||||||
full_page_url="$location"
|
full_page_url="$location"
|
||||||
elif [ "${path_url}" == "/" ]; then
|
elif [ "${path_url}" == "/" ]; then
|
||||||
# if $path_url points to the webserver root just append $location to localhost URL
|
# if $path_url points to the webserver root just append $location to localhost URL
|
||||||
|
flohmarkt_normalize_url_path
|
||||||
full_page_url="https://localhost${location}"
|
full_page_url="https://localhost${location}"
|
||||||
else
|
else
|
||||||
# else append $path_url and $location to localhost URL
|
# else append $path_url and $location to localhost URL
|
||||||
|
flohmarkt_normalize_url_path
|
||||||
full_page_url="https://localhost${path_url}${location}"
|
full_page_url="https://localhost${path_url}${location}"
|
||||||
fi
|
fi
|
||||||
flohmarkt_print_debug "full_page_url='$full_page_url'"
|
flohmarkt_print_debug "full_page_url='$full_page_url'"
|
||||||
|
|
Loading…
Reference in a new issue