php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
html.c File Reference
#include "php.h"
#include <php_config.h>
#include "php_standard.h"
#include "SAPI.h"
#include <locale.h>
#include <zend_hash.h>
#include "html_tables.h"

Go to the source code of this file.

Macros

#define LIMIT_ALL(all, doctype, charset)
 
#define MB_FAILURE(pos, advance)
 
#define CHECK_LEN(pos, chars_need)
 
#define utf8_lead(c)
 
#define utf8_trail(c)
 
#define gb2312_lead(c)
 
#define gb2312_trail(c)
 
#define sjis_lead(c)
 
#define sjis_trail(c)
 
#define TRAVERSE_FOR_ENTITIES_EXPAND_SIZE(oldlen)
 

Functions

PHPAPI unsigned int php_next_utf8_char (const unsigned char *str, size_t str_len, size_t *cursor, zend_result *status)
 
PHPAPI zend_stringphp_unescape_html_entities (zend_string *str, int all, int flags, const char *hint_charset)
 
PHPAPI zend_stringphp_escape_html_entities (const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset)
 
PHPAPI zend_stringphp_escape_html_entities_ex (const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet)
 
 PHP_FUNCTION (htmlspecialchars)
 
 PHP_FUNCTION (htmlspecialchars_decode)
 
 PHP_FUNCTION (html_entity_decode)
 
 PHP_FUNCTION (htmlentities)
 
 PHP_FUNCTION (get_html_translation_table)
 

Macro Definition Documentation

◆ CHECK_LEN

#define CHECK_LEN ( pos,
chars_need )
Value:
((str_len - (pos)) >= (chars_need))
unsigned const char * pos
Definition php_ffi.h:52

Definition at line 62 of file html.c.

◆ gb2312_lead

#define gb2312_lead ( c)
Value:
((c) != 0x8E && (c) != 0x8F && (c) != 0xA0 && (c) != 0xFF)

Definition at line 71 of file html.c.

◆ gb2312_trail

#define gb2312_trail ( c)
Value:
((c) >= 0xA1 && (c) <= 0xFE)

Definition at line 72 of file html.c.

◆ LIMIT_ALL

#define LIMIT_ALL ( all,
doctype,
charset )
Value:
do { \
(all) = (all) && !CHARSET_PARTIAL_SUPPORT((charset)) && ((doctype) != ENT_HTML_DOC_XML1); \
} while (0)
#define CHARSET_PARTIAL_SUPPORT(cs)
Definition html_tables.h:34
enum entity_charset charset
Definition html_tables.h:39
#define ENT_HTML_DOC_XML1
Definition html.h:27

Definition at line 52 of file html.c.

◆ MB_FAILURE

#define MB_FAILURE ( pos,
advance )
Value:
do { \
*cursor = pos + (advance); \
return 0; \
} while (0)
DNS_STATUS status
Definition dns_win32.c:49
@ FAILURE
Definition zend_types.h:61

Definition at line 56 of file html.c.

◆ sjis_lead

#define sjis_lead ( c)
Value:
((c) != 0x80 && (c) != 0xA0 && (c) < 0xFD)

Definition at line 74 of file html.c.

◆ sjis_trail

#define sjis_trail ( c)
Value:
((c) >= 0x40 && (c) != 0x7F && (c) < 0xFD)

Definition at line 75 of file html.c.

◆ TRAVERSE_FOR_ENTITIES_EXPAND_SIZE

#define TRAVERSE_FOR_ENTITIES_EXPAND_SIZE ( oldlen)
Value:
((oldlen) + (oldlen) / 5 + 2)

Definition at line 814 of file html.c.

◆ utf8_lead

#define utf8_lead ( c)
Value:
((c) < 0x80 || ((c) >= 0xC2 && (c) <= 0xF4))

Definition at line 65 of file html.c.

◆ utf8_trail

#define utf8_trail ( c)
Value:
((c) >= 0x80 && (c) <= 0xBF)

Definition at line 69 of file html.c.

Function Documentation

◆ php_escape_html_entities()

PHPAPI zend_string * php_escape_html_entities ( const unsigned char * old,
size_t oldlen,
int all,
int flags,
const char * hint_charset )

Definition at line 1012 of file html.c.

◆ php_escape_html_entities_ex()

PHPAPI zend_string * php_escape_html_entities_ex ( const unsigned char * old,
size_t oldlen,
int all,
int flags,
const char * hint_charset,
bool double_encode,
bool quiet )

Definition at line 1099 of file html.c.

◆ PHP_FUNCTION() [1/5]

PHP_FUNCTION ( get_html_translation_table )

Definition at line 1443 of file html.c.

◆ PHP_FUNCTION() [2/5]

PHP_FUNCTION ( html_entity_decode )

Definition at line 1360 of file html.c.

◆ PHP_FUNCTION() [3/5]

PHP_FUNCTION ( htmlentities )

Definition at line 1381 of file html.c.

◆ PHP_FUNCTION() [4/5]

PHP_FUNCTION ( htmlspecialchars )

Definition at line 1335 of file html.c.

◆ PHP_FUNCTION() [5/5]

PHP_FUNCTION ( htmlspecialchars_decode )

all

Definition at line 1342 of file html.c.

◆ php_next_utf8_char()

PHPAPI unsigned int php_next_utf8_char ( const unsigned char * str,
size_t str_len,
size_t * cursor,
zend_result * status )

Definition at line 351 of file html.c.

◆ php_unescape_html_entities()

PHPAPI zend_string * php_unescape_html_entities ( zend_string * str,
int all,
int flags,
const char * hint_charset )

Definition at line 976 of file html.c.