Bug #336: Only accept http/https/ftp/file protocols in sources.

This commit is contained in:
Juergen Daubert 2008-11-01 18:17:44 +01:00 committed by Tilman Sauerbeck
parent 51c534c2bd
commit 7b3f9929cb

View File

@ -34,13 +34,11 @@ error() {
}
get_filename() {
local FILE="`echo $1 | sed 's|^.*://.*/||g'`"
if [ "$FILE" != "$1" ]; then
FILE="$PKGMK_SOURCE_DIR/$FILE"
if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
echo "$PKGMK_SOURCE_DIR/${BASH_REMATCH[2]}"
else
echo $1
fi
echo $FILE
}
get_basename() {