cgiEscape(3)

cgiEscape3

Html escape certain characters in a string

Synopsys

#include <cgi.h>

char *cgiEscape (char *string);

Overview

This function returns a pointer to a sanitised string. It converts <, & and > into HTML entities so that the result can be displayed without any danger of cross-site scripting in a browser. The result may be passed to free(3) after use. This routine is meant to be called before any user provided strings are returned to the browser.

Return value

cgiEscape() returns a pointer to the sanitised string or NULL in case of error.

Releases

Unchanged in 7 releases since Debian 5.0 (Lenny).

  1. 5.0–11

Author

This CGi library is written by Martin Schulze <[email protected]>. If you have additions or improvements please get in touch with him.

From cgilib 0.6-1.1+b1 in Debian 11 (Bullseye). Parsed by carta from the page's man source.