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

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Wed Jan 26 09:37:41 PST 2022


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#4233 - awk from busybox-v1.35.0 doesn't work.
User who did this - Semen (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 "


  
    
    AWK form submission example
    
      form {
        width: 420px;
      }

      div {
        margin-bottom: 20px;
      }

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

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

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=4233#comment10486

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list