1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1997-2018 The PHP Group | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 3.01 of the PHP license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.php.net/license/3_01.txt | 11 | If you did not receive a copy of the PHP license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@php.net so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | 16 +----------------------------------------------------------------------+ 17 */ 18 19 #ifndef HTML_H 20 #define HTML_H 21 22 #define ENT_HTML_QUOTE_NONE 0 23 #define ENT_HTML_QUOTE_SINGLE 1 24 #define ENT_HTML_QUOTE_DOUBLE 2 25 #define ENT_HTML_IGNORE_ERRORS 4 26 #define ENT_HTML_SUBSTITUTE_ERRORS 8 27 #define ENT_HTML_DOC_TYPE_MASK (16|32) 28 #define ENT_HTML_DOC_HTML401 0 29 #define ENT_HTML_DOC_XML1 16 30 #define ENT_HTML_DOC_XHTML 32 31 #define ENT_HTML_DOC_HTML5 (16|32) 32 /* reserve bit 6 */ 33 #define ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS 128 34 35 36 #define ENT_COMPAT ENT_HTML_QUOTE_DOUBLE 37 #define ENT_QUOTES (ENT_HTML_QUOTE_DOUBLE | ENT_HTML_QUOTE_SINGLE) 38 #define ENT_NOQUOTES ENT_HTML_QUOTE_NONE 39 #define ENT_IGNORE ENT_HTML_IGNORE_ERRORS 40 #define ENT_SUBSTITUTE ENT_HTML_SUBSTITUTE_ERRORS 41 #define ENT_HTML401 0 42 #define ENT_XML1 16 43 #define ENT_XHTML 32 44 #define ENT_HTML5 (16|32) 45 #define ENT_DISALLOWED 128 46 47 void register_html_constants(INIT_FUNC_ARGS); 48 49 PHP_FUNCTION(htmlspecialchars); 50 PHP_FUNCTION(htmlentities); 51 PHP_FUNCTION(htmlspecialchars_decode); 52 PHP_FUNCTION(html_entity_decode); 53 PHP_FUNCTION(get_html_translation_table); 54 55 PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset); 56 PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode); 57 PHPAPI zend_string *php_unescape_html_entities(zend_string *str, int all, int flags, char *hint_charset); 58 PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status); 59 60 #endif /* HTML_H */ 61