From 2a27d1c6f479daa1e5877e639e7b890e7fc8bfc2 Mon Sep 17 00:00:00 2001 From: Martin Michel Date: Tue, 31 May 2011 23:47:08 +0200 Subject: Splash Bug (iframe) fixed diff --git a/files/www/cgi-bin/redirect b/files/www/cgi-bin/redirect index 75979e2..9b417db 100755 --- a/files/www/cgi-bin/redirect +++ b/files/www/cgi-bin/redirect @@ -3,6 +3,6 @@ echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" echo -en "Pragma: no-cache\r\n" echo -en "Expires: -1\r\n" echo -en "Status: 302 Temporary Redirect\r\n" -echo -en "Location: http://"`uci get network.mesh.ipaddr`"/cgi-bin/splash?http://"`echo $HTTP_HOST$REQUEST_URI`"\r\n" +echo -en "Location: http://"`uci get network.mesh.ipaddr`"/cgi-bin/splash?"`/bin/urlencode "$HTTP_HOST$REQUEST_URI"`"\r\n" echo -en "\r\n" exit 0 diff --git a/files/www/cgi-bin/splash b/files/www/cgi-bin/splash index 2212eba..ee907d6 100755 --- a/files/www/cgi-bin/splash +++ b/files/www/cgi-bin/splash @@ -2,5 +2,7 @@ echo -en "Status: 200 OK\r\n" echo -en "Content-Type: text/html\r\n" echo -en "\r\n" -targeturl=$(echo $QUERY_STRING | sed -f /etc/urlencode.sed) +#targeturl=$(echo $QUERY_STRING) +#targeturl=$(echo $QUERY_STRING | sed -f /etc/urlencode.sed) +targeturl=`echo $QUERY_STRING` sed "s/targeturl/"$targeturl"/g" /www/splash.html diff --git a/files/www/cgi-bin/splash_click b/files/www/cgi-bin/splash_click index b868658..b54b15a 100755 --- a/files/www/cgi-bin/splash_click +++ b/files/www/cgi-bin/splash_click @@ -2,7 +2,10 @@ echo -en "Status: 200 OK\r\n" echo -en "Content-Type: text/html\r\n" echo -en "\r\n" - +TEST=`cat ` +TEST=`echo $TEST | sed 's/'target_url='/''/g'` +TEST=`/bin/urldecode "$TEST"` +TEST=`echo $TEST | sed 's/%2F/\//g'` . $IPKG_INSTROOT/etc/functions.sh ISSPLASHED=0 config_load splash_users @@ -14,8 +17,7 @@ is_ip() { } #check if user is alredy splashed config_foreach is_ip user -targeturl=$(echo $QUERY_STRING | sed 's/+/ /g; s/%/\\x/g') -sed "s/targeturl/"$targeturl"/g" /www/iframe.html +sed 's/targeturl/'"$(echo $TEST| sed 's#/#\\/#g')"'/g' /www/iframe.html if [ $ISSPLASHED -eq 1 ]; then exit -- cgit v0.10.1