Re: [Nagios-devel] Fixes for url_encode()
Posted: Mon Oct 25, 2004 8:04 am
I actually found I had problems (with Apan, primarily) if I didn't skip
underscores and hyphens, as well. Don't know about the RFC adherence,
though.
Here's my diff against the current CVS:
---------------
Index: cgi/cgiutils.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/cgiutils.c,v
retrieving revision 1.38
diff -u -r1.38 cgiutils.c
--- cgi/cgiutils.c 25 Oct 2004 05:05:54 -0000 1.38
+++ cgi/cgiutils.c 25 Oct 2004 15:56:42 -0000
@@ -1291,8 +1291,8 @@
break;
}
- /* alpha-numeric characters and dots don't get encoded
*/
- else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x]='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] In the original CVS version of url_encode() only alphanumerical
> characters were left unencoded. This is in violation of RFC1866, which
> also excludes dots from url encoding schemes.
>
> Standards compliant browsers (such as Mozilla Firefox) may experience
> problems with url encoded dots.
>
> This patch includes dots ('.') in the characters not being url encoded
> and thus fixes the problem.
>
> Plain text document attachment (nagios-cgi-url_encode.diff)
> diff -urN ../Nagios/cgi/cgiutils.c ./cgi/cgiutils.c
> --- ../Nagios/cgi/cgiutils.c Fri Oct 22 18:51:31 2004
> +++ ./cgi/cgiutils.c Sat Oct 23 12:17:54 2004
> @@ -1291,8 +1291,8 @@
> break;
> }
>
> - /* alpha-numeric characters don't get encoded */
> - else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] + /* alpha-numeric characters and dots don't get encoded */
> + else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] encoded_url_string[y]=input[x];
> y++;
> }
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
underscores and hyphens, as well. Don't know about the RFC adherence,
though.
Here's my diff against the current CVS:
---------------
Index: cgi/cgiutils.c
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/cgiutils.c,v
retrieving revision 1.38
diff -u -r1.38 cgiutils.c
--- cgi/cgiutils.c 25 Oct 2004 05:05:54 -0000 1.38
+++ cgi/cgiutils.c 25 Oct 2004 15:56:42 -0000
@@ -1291,8 +1291,8 @@
break;
}
- /* alpha-numeric characters and dots don't get encoded
*/
- else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x]='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] In the original CVS version of url_encode() only alphanumerical
> characters were left unencoded. This is in violation of RFC1866, which
> also excludes dots from url encoding schemes.
>
> Standards compliant browsers (such as Mozilla Firefox) may experience
> problems with url encoded dots.
>
> This patch includes dots ('.') in the characters not being url encoded
> and thus fixes the problem.
>
> Plain text document attachment (nagios-cgi-url_encode.diff)
> diff -urN ../Nagios/cgi/cgiutils.c ./cgi/cgiutils.c
> --- ../Nagios/cgi/cgiutils.c Fri Oct 22 18:51:31 2004
> +++ ./cgi/cgiutils.c Sat Oct 23 12:17:54 2004
> @@ -1291,8 +1291,8 @@
> break;
> }
>
> - /* alpha-numeric characters don't get encoded */
> - else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] + /* alpha-numeric characters and dots don't get encoded */
> + else if(((char)input[x]>='0' && (char)input[x]='A' && (char)input[x]=(char)'a' && (char)input[x] encoded_url_string[y]=input[x];
> y++;
> }
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]