From 29ba4fd0d667d26a9151b093341f4864b4ef9395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 16 Jan 2023 17:30:37 +0100 Subject: [PATCH] fix comma in filename (curl param) --- src/bash/filter.sh | 3 ++- src/bash/filterTest.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/bash/filter.sh mode change 100755 => 100644 src/bash/filterTest.sh diff --git a/src/bash/filter.sh b/src/bash/filter.sh old mode 100755 new mode 100644 index b27dc5d..fac965d --- a/src/bash/filter.sh +++ b/src/bash/filter.sh @@ -123,7 +123,8 @@ curlJirafeauSend () { type=$3 [ -z "${type}" ] && type="text/plain" LOG_FIC " - curl -X POST -F \"time=$1\" -F \"key=$5\" -F \"file=@$2;type=${type};filename=$4\" \"${JIRAFEAU_LOCAL}/a.php\"" - curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=$4" "${JIRAFEAU_LOCAL}/a.php" + LOG "curl -X POST -F \"time=$1\" -F \"key=$5\" -F \"file=@$2;type=${type};filename=\\\"$4\\\"\" \"${JIRAFEAU_LOCAL}/a.php\"" + curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php" } #################### MAIN ################################################# diff --git a/src/bash/filterTest.sh b/src/bash/filterTest.sh old mode 100755 new mode 100644 index fe9275f..74e3447 --- a/src/bash/filterTest.sh +++ b/src/bash/filterTest.sh @@ -61,6 +61,7 @@ usage () { ######################################## # recherche des binaires +mbox=$(realpath "$1") cd $(dirname $0) eMailShrinker="$(realpath "./eMailShrinker")" [ -x "${eMailShrinker}" ] || eMailShrinker="$(realpath "../../build/out/eMailShrinker")" @@ -85,7 +86,6 @@ esac [ "$#" -eq 1 ] || usage ######################################## -mbox=$(realpath "$1") dos2unix "${mbox}" DOMAINNAME="$(cat domainname)" JIRAFEAU_URL="https://depot.${DOMAINNAME}" @@ -112,7 +112,8 @@ curlJirafeauSend () { type=$3 [ -z "${type}" ] && type="text/plain" - curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=$4" "${JIRAFEAU_LOCAL}/a.php" + LOG "curl -X POST -F \"time=$1\" -F \"key=$5\" -F \"file=@$2;type=${type};filename=\\\"$4\\\"\" \"${JIRAFEAU_LOCAL}/a.php\"" + curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php" #"${jirafeauAPI}" -f "${JIRAFEAU_LOCAL}" -t "$1" -s "1Gi" -c "${type}" -n "$4" send "$2" "$5" }