Fix parsing empty QUERY_STRING
[infodrom/cgilib] / cgiEscape.3
1 .\" cgiDebug - Set the debug level for CGI programming
2 .\" Copyright (c) 2007,8 by Martin Schulze <joey@infodrom.org>
3 .\" 
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\" 
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 .\" GNU General Public License for more details.
13 .\" 
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software Foundation
16 .\" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 .\"
18 .TH cgiDebug 3 "6 April 2008" "CGI Library" "Programmer's Manual"
19 .SH NAME
20 cgiEscape \- HTML escape certain characters in a string
21 .SH SYNOPSYS
22 .nf
23 .B #include <cgi.h>
24 .sp
25 .BI "char *cgiEscape (char *" string );
26 .fi
27 .SH DESCRIPTION
28 This function returns a pointer to a sanitised string.
29 It converts
30 .BR < ", " & " and " >
31 into HTML entities so that the result can be displayed without any
32 danger of cross-site scripting in a browser.
33 The result may be passed to
34 .BR free (3)
35 after use.
36 This routine is meant to be called before any user provided strings
37 are returned to the browser.
38 .SH "RETURN VALUE"
39 .BR cgiEscape ()
40 returns a pointer to the sanitised string or NULL in case of error.
41 .SH "AUTHOR"
42 This CGi library is written by Martin Schulze
43 <joey@infodrom.org>.  If you have additions or improvements
44 please get in touch with him.
45
46 .SH "SEE ALSO"
47 .BR free (3).
48