Parcourir la source

replace + with %2B to bypass encoding

Serghey Rodin il y a 12 ans
Parent
commit
d9dde8517b
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      func/remote.sh

+ 1 - 0
func/remote.sh

@@ -9,6 +9,7 @@ send_api_cmd() {
     auth="user=$USER&password=$PASSWORD&returncode=yes"
     cmd="cmd=$1"
     args="arg1=$2&arg2=$3&arg3=$4&arg4=$5&arg5=$6&arg6=$7&arg7=$8&arg8=$9"
+    args=$(echo "$args" |sed -e "s/+/%2B/g")
     answer=$(curl -s -k --data "$auth&$cmd&$args" https://$HOST:$PORT/api/)
     if [ "$answer" != '0' ]; then
         return 1