Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#4233 - awk from busybox-v1.35.0 doesn't work. #9214

Open
openwrt-bot opened this issue Jan 20, 2022 · 2 comments
Open

FS#4233 - awk from busybox-v1.35.0 doesn't work. #9214

openwrt-bot opened this issue Jan 20, 2022 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

melsem:

Form data handler '

' is not executed.
awk problem with busybox-v1.35.0-1.

Reverting awk itself to busybox-v1.33.1 and rebuilding.
And the awk scripting engine works.

The patch is needed in: /openwrt-master/package/utils/busybox/patches/521-revert_awk_busybox-1.33.1.patch

@openwrt-bot
Copy link
Author

melsem:

[[https://drive.google.com/file/d/1Qi-sMcafqkEqdIs7Q0pZd3QN_RHWoGvh/view?usp=sharing|External Link for 521-revert_awk_busybox-1.33.1.patch]]

@openwrt-bot
Copy link
Author

melsem:

Form data handler: awk-scripts.cgi#!/usr/bin/awk -f
function unescape(s)
{
gsub(/+/," ",s)
res = ""
do {
p = match(s,/%[0-9a-fA-F]{2}/)
if(p>0) {
res = res substr(s,0,p-1) sprintf("%c",0+("0x" substr(s,p+1,2)))
s = substr(s,p+3)
}
} while(p>0)
return res s
}
BEGIN
{
RS = "&"
FS = "="
print "Content-type: text/html; charset=utf-8"
print ""
}
{

if($1 == "name_text1") text_value1 = unescape($2)
if($1 == "name_text2") text_value2 = unescape($2)

}
END
{
print "Greetings: "text_value1"
"
print " Name: "text_value2"
"
}

example.html #!/bin/sh
echo "

<title>AWK form submission example</title> <style> form { width: 420px; }
  div {
    margin-bottom: 20px;
  }

  label {
    display: inline-block;
    width: 240px;
    text-align: right;
    padding-right: 10px;
  }

  button, input {
    float: right;
  }
</style>
What greeting do you want to say?
Who do you want to say it to?
Send my greetings
"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant