php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
filter.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Authors: Rasmus Lerdorf <rasmus@php.net> |
14 | Derick Rethans <derick@php.net> |
15 | Pierre-A. Joye <pierre@php.net> |
16 | Ilia Alshanetsky <iliaa@php.net> |
17 +----------------------------------------------------------------------+
18*/
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24#include "php_filter.h"
25#include "main/php_variables.h"
26#include "ext/standard/info.h"
27
29
30#include "filter_private.h"
31#include "filter_arginfo.h"
32
38
39/* {{{ filter_list */
40static const filter_list_entry filter_list[] = {
44
51
63
64 { "callback", FILTER_CALLBACK, php_filter_callback },
65};
66/* }}} */
67
68#ifndef PARSE_ENV
69#define PARSE_ENV 4
70#endif
71
72#ifndef PARSE_SERVER
73#define PARSE_SERVER 5
74#endif
75
76static unsigned int php_sapi_filter(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len);
77static unsigned int php_sapi_filter_init(void);
78
79/* {{{ filter_module_entry */
82 "filter",
83 ext_functions,
84 PHP_MINIT(filter),
85 PHP_MSHUTDOWN(filter),
86 NULL,
87 PHP_RSHUTDOWN(filter),
88 PHP_MINFO(filter),
91};
92/* }}} */
93
94#ifdef COMPILE_DL_FILTER
95#ifdef ZTS
97#endif
98ZEND_GET_MODULE(filter)
99#endif
100
101static PHP_INI_MH(UpdateDefaultFilter) /* {{{ */
102{
103 int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
104
105 for (i = 0; i < size; ++i) {
106 if ((strcasecmp(ZSTR_VAL(new_value), filter_list[i].name) == 0)) {
107 IF_G(default_filter) = filter_list[i].id;
109 zend_error(E_DEPRECATED, "The filter.default ini setting is deprecated");
110 }
111 return SUCCESS;
112 }
113 }
114 /* Fallback to the default filter */
116 return SUCCESS;
117}
118/* }}} */
119
120/* {{{ PHP_INI */
121static PHP_INI_MH(OnUpdateFlags)
122{
123 if (!new_value) {
125 } else {
126 IF_G(default_filter_flags) = atoi(ZSTR_VAL(new_value));
127 }
128 return SUCCESS;
129}
130
132 STD_PHP_INI_ENTRY("filter.default", "unsafe_raw", PHP_INI_SYSTEM|PHP_INI_PERDIR, UpdateDefaultFilter, default_filter, zend_filter_globals, filter_globals)
133 PHP_INI_ENTRY("filter.default_flags", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateFlags)
135/* }}} */
136
137static void php_filter_init_globals(zend_filter_globals *filter_globals) /* {{{ */
138{
139#if defined(COMPILE_DL_FILTER) && defined(ZTS)
141#endif
142 ZVAL_UNDEF(&filter_globals->post_array);
143 ZVAL_UNDEF(&filter_globals->get_array);
144 ZVAL_UNDEF(&filter_globals->cookie_array);
145 ZVAL_UNDEF(&filter_globals->env_array);
146 ZVAL_UNDEF(&filter_globals->server_array);
147#if 0
148 ZVAL_UNDEF(&filter_globals->session_array);
149#endif
150 filter_globals->default_filter = FILTER_DEFAULT;
151}
152/* }}} */
153
154/* {{{ PHP_MINIT_FUNCTION */
156{
157 ZEND_INIT_MODULE_GLOBALS(filter, php_filter_init_globals, NULL);
158
160
161 register_filter_symbols(module_number);
162
163 sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init);
164
165 return SUCCESS;
166}
167/* }}} */
168
169/* {{{ PHP_MSHUTDOWN_FUNCTION */
171{
173
174 return SUCCESS;
175}
176/* }}} */
177
178/* {{{ PHP_RSHUTDOWN_FUNCTION */
179#define VAR_ARRAY_COPY_DTOR(a) \
180 if (!Z_ISUNDEF(IF_G(a))) { \
181 zval_ptr_dtor(&IF_G(a)); \
182 ZVAL_UNDEF(&IF_G(a)); \
183 }
184
197/* }}} */
198
199/* {{{ PHP_MINFO_FUNCTION */
201{
203 php_info_print_table_row( 2, "Input Validation and Filtering", "enabled" );
205
207}
208/* }}} */
209
210static filter_list_entry php_find_filter(zend_long id) /* {{{ */
211{
212 int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
213
214 for (i = 0; i < size; ++i) {
215 if (filter_list[i].id == id) {
216 return filter_list[i];
217 }
218 }
219 /* Fallback to "string" filter */
220 for (i = 0; i < size; ++i) {
221 if (filter_list[i].id == FILTER_DEFAULT) {
222 return filter_list[i];
223 }
224 }
225 /* To shut up GCC */
226 return filter_list[0];
227}
228/* }}} */
229
230static unsigned int php_sapi_filter_init(void)
231{
237#if 0
238 ZVAL_UNDEF(&IF_G(session_array));
239#endif
240 return SUCCESS;
241}
242
243static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, bool copy) /* {{{ */
244{
245 filter_list_entry filter_func;
246
247 filter_func = php_find_filter(filter);
248
249 if (!filter_func.id) {
250 /* Find default filter */
251 filter_func = php_find_filter(FILTER_DEFAULT);
252 }
253
254 /* #49274, fatal error with object without a toString method
255 Fails nicely instead of getting a recovarable fatal error. */
256 if (Z_TYPE_P(value) == IS_OBJECT) {
258
259 ce = Z_OBJCE_P(value);
260 if (!ce->__tostring) {
262 /* #67167: doesn't return null on failure for objects */
265 } else {
267 }
268 goto handle_default;
269 }
270 }
271
272 /* Here be strings */
274
275 filter_func.function(value, flags, options, charset);
276
277handle_default:
278 if (options && Z_TYPE_P(options) == IS_ARRAY &&
281 zval *tmp;
282 if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "default", sizeof("default") - 1)) != NULL) {
283 ZVAL_COPY(value, tmp);
284 }
285 }
286}
287/* }}} */
288
289static unsigned int php_sapi_filter(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len) /* {{{ */
290{
291 zval new_var, raw_var;
292 zval *array_ptr = NULL, *orig_array_ptr = NULL;
293 int retval = 0;
294
295 assert(*val != NULL);
296
297#define PARSE_CASE(s,a,t) \
298 case s: \
299 if (Z_ISUNDEF(IF_G(a))) { \
300 array_init(&IF_G(a)); \
301 } \
302 array_ptr = &IF_G(a); \
303 orig_array_ptr = &PG(http_globals)[t]; \
304 break;
305
306 switch (arg) {
312
313 case PARSE_STRING: /* PARSE_STRING is used by parse_str() function */
314 retval = 1;
315 break;
316 }
317
318 /*
319 * According to rfc2965, more specific paths are listed above the less specific ones.
320 * If we encounter a duplicate cookie name, we should skip it, since it is not possible
321 * to have the same (plain text) cookie name for the same path and we should not overwrite
322 * more specific cookies with the less specific ones.
323 */
324 if (arg == PARSE_COOKIE && orig_array_ptr &&
325 zend_symtable_str_exists(Z_ARRVAL_P(orig_array_ptr), var, strlen(var))) {
326 return 0;
327 }
328
329 if (array_ptr) {
330 /* Store the RAW variable internally */
331 ZVAL_STRINGL(&raw_var, *val, val_len);
332 php_register_variable_ex(var, &raw_var, array_ptr);
333 }
334
335 if (val_len) {
336 /* Register mangled variable */
338 ZVAL_STRINGL(&new_var, *val, val_len);
339 php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0);
340 } else {
341 ZVAL_STRINGL(&new_var, *val, val_len);
342 }
343 } else { /* empty string */
344 ZVAL_EMPTY_STRING(&new_var);
345 }
346
347 if (orig_array_ptr) {
348 php_register_variable_ex(var, &new_var, orig_array_ptr);
349 }
350
351 if (retval) {
352 if (new_val_len) {
353 *new_val_len = Z_STRLEN(new_var);
354 }
355 efree(*val);
356 if (Z_STRLEN(new_var)) {
357 *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var));
358 } else {
359 *val = estrdup("");
360 }
361 zval_ptr_dtor(&new_var);
362 }
363
364 return retval;
365}
366/* }}} */
367
368static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, bool copy) /* {{{ */
369{
370 if (Z_TYPE_P(value) == IS_ARRAY) {
371 zval *element;
372
373 if (Z_IS_RECURSIVE_P(value)) {
374 return;
375 }
377
379 ZVAL_DEREF(element);
380 if (Z_TYPE_P(element) == IS_ARRAY) {
381 SEPARATE_ARRAY(element);
382 php_zval_filter_recursive(element, filter, flags, options, charset, copy);
383 } else {
384 php_zval_filter(element, filter, flags, options, charset, copy);
385 }
388 } else {
389 php_zval_filter(value, filter, flags, options, charset, copy);
390 }
391}
392/* }}} */
393
394static zval *php_filter_get_storage(zend_long arg)/* {{{ */
395
396{
397 zval *array_ptr = NULL;
398
399 switch (arg) {
400 case PARSE_GET:
401 array_ptr = &IF_G(get_array);
402 break;
403 case PARSE_POST:
404 array_ptr = &IF_G(post_array);
405 break;
406 case PARSE_COOKIE:
407 array_ptr = &IF_G(cookie_array);
408 break;
409 case PARSE_SERVER:
410 if (PG(auto_globals_jit)) {
411 zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_SERVER));
412 }
413 array_ptr = &IF_G(server_array);
414 break;
415 case PARSE_ENV:
416 if (PG(auto_globals_jit)) {
417 zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_ENV));
418 }
419 array_ptr = !Z_ISUNDEF(IF_G(env_array)) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
420 break;
421 default:
422 zend_argument_value_error(1, "must be an INPUT_* constant");
423 return NULL;
424 }
425
426 if (array_ptr && Z_TYPE_P(array_ptr) != IS_ARRAY) {
427 /* Storage not initialized */
428 return NULL;
429 }
430
431 return array_ptr;
432}
433/* }}} */
434
435/* {{{ Returns true if the variable with the name 'name' exists in source. */
437{
439 zend_string *var;
440 zval *array_ptr = NULL;
441
442 if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS", &arg, &var) == FAILURE) {
444 }
445
446 array_ptr = php_filter_get_storage(arg);
447 if (EG(exception)) {
449 }
450
451 if (array_ptr && zend_hash_exists(Z_ARRVAL_P(array_ptr), var)) {
453 }
454
456}
457/* }}} */
458
459static void php_filter_call(
460 zval *filtered, zend_long filter, HashTable *filter_args_ht, zend_long filter_args_long,
461 const int copy, zend_long filter_flags
462) /* {{{ */ {
463 zval *options = NULL;
464 zval *option;
465 char *charset = NULL;
466
467 if (!filter_args_ht) {
468 if (filter != -1) { /* handler for array apply */
469 /* filter_args is the filter_flags */
470 filter_flags = filter_args_long;
471
472 if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) {
473 filter_flags |= FILTER_REQUIRE_SCALAR;
474 }
475 } else {
476 filter = filter_args_long;
477 }
478 } else {
479 if ((option = zend_hash_str_find(filter_args_ht, "filter", sizeof("filter") - 1)) != NULL) {
480 filter = zval_get_long(option);
481 }
482
483 if ((option = zend_hash_str_find_deref(filter_args_ht, "options", sizeof("options") - 1)) != NULL) {
484 if (filter != FILTER_CALLBACK) {
485 if (Z_TYPE_P(option) == IS_ARRAY) {
486 options = option;
487 }
488 } else {
489 options = option;
490 filter_flags = 0;
491 }
492 }
493
494 if ((option = zend_hash_str_find(filter_args_ht, "flags", sizeof("flags") - 1)) != NULL) {
495 filter_flags = zval_get_long(option);
496
497 if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) {
498 filter_flags |= FILTER_REQUIRE_SCALAR;
499 }
500 }
501 }
502
503 if (Z_TYPE_P(filtered) == IS_ARRAY) {
504 if (filter_flags & FILTER_REQUIRE_SCALAR) {
505 zval_ptr_dtor(filtered);
506 if (filter_flags & FILTER_NULL_ON_FAILURE) {
507 ZVAL_NULL(filtered);
508 } else {
509 ZVAL_FALSE(filtered);
510 }
511 return;
512 }
513 php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy);
514 return;
515 }
516 if (filter_flags & FILTER_REQUIRE_ARRAY) {
517 zval_ptr_dtor(filtered);
518 if (filter_flags & FILTER_NULL_ON_FAILURE) {
519 ZVAL_NULL(filtered);
520 } else {
521 ZVAL_FALSE(filtered);
522 }
523 return;
524 }
525
526 php_zval_filter(filtered, filter, filter_flags, options, charset, copy);
527 if (filter_flags & FILTER_FORCE_ARRAY) {
528 zval tmp;
529 ZVAL_COPY_VALUE(&tmp, filtered);
530 array_init(filtered);
531 add_next_index_zval(filtered, &tmp);
532 }
533}
534/* }}} */
535
536static void php_filter_array_handler(zval *input, HashTable *op_ht, zend_long op_long,
537 zval *return_value, bool add_empty
538) /* {{{ */ {
539 zend_string *arg_key;
540 zval *tmp, *arg_elm;
541
542 if (!op_ht) {
543 ZVAL_DUP(return_value, input);
544 php_filter_call(return_value, -1, NULL, op_long, 0, FILTER_REQUIRE_ARRAY);
545 } else {
547
548 ZEND_HASH_FOREACH_STR_KEY_VAL(op_ht, arg_key, arg_elm) {
549 if (arg_key == NULL) {
550 zend_argument_type_error(2, "must contain only string keys");
552 }
553 if (ZSTR_LEN(arg_key) == 0) {
554 zend_argument_value_error(2, "cannot contain empty keys");
556 }
557 if ((tmp = zend_hash_find(Z_ARRVAL_P(input), arg_key)) == NULL) {
558 if (add_empty) {
559 add_assoc_null_ex(return_value, ZSTR_VAL(arg_key), ZSTR_LEN(arg_key));
560 }
561 } else {
562 zval nval;
563 ZVAL_DEREF(tmp);
564 ZVAL_DUP(&nval, tmp);
565 php_filter_call(&nval, -1,
566 Z_TYPE_P(arg_elm) == IS_ARRAY ? Z_ARRVAL_P(arg_elm) : NULL,
567 Z_TYPE_P(arg_elm) == IS_ARRAY ? 0 : zval_get_long(arg_elm),
569 );
570 zend_hash_update(Z_ARRVAL_P(return_value), arg_key, &nval);
571 }
573 }
574}
575/* }}} */
576
577/* {{{ Returns the filtered variable 'name'* from source `type`. */
579{
580 zend_long fetch_from, filter = FILTER_DEFAULT;
581 zval *input = NULL, *tmp;
582 zend_string *var;
583 HashTable *filter_args_ht = NULL;
584 zend_long filter_args_long = 0;
585
587 Z_PARAM_LONG(fetch_from)
588 Z_PARAM_STR(var)
590 Z_PARAM_LONG(filter)
591 Z_PARAM_ARRAY_HT_OR_LONG(filter_args_ht, filter_args_long)
593
594 if (!PHP_FILTER_ID_EXISTS(filter)) {
595 php_error_docref(NULL, E_WARNING, "Unknown filter with ID " ZEND_LONG_FMT, filter);
597 }
598
599 input = php_filter_get_storage(fetch_from);
600 if (EG(exception)) {
602 }
603
604 if (!input || (tmp = zend_hash_find(Z_ARRVAL_P(input), var)) == NULL) {
605 zend_long filter_flags = 0;
606 zval *option, *opt, *def;
607 if (!filter_args_ht) {
608 filter_flags = filter_args_long;
609 } else {
610 if ((option = zend_hash_str_find(filter_args_ht, "flags", sizeof("flags") - 1)) != NULL) {
611 filter_flags = zval_get_long(option);
612 }
613
614 if ((opt = zend_hash_str_find_deref(filter_args_ht, "options", sizeof("options") - 1)) != NULL &&
615 Z_TYPE_P(opt) == IS_ARRAY &&
616 (def = zend_hash_str_find_deref(Z_ARRVAL_P(opt), "default", sizeof("default") - 1)) != NULL
617 ) {
619 return;
620 }
621 }
622
623 /* The FILTER_NULL_ON_FAILURE flag inverts the usual return values of
624 * the function: normally when validation fails false is returned, and
625 * when the input value doesn't exist NULL is returned. With the flag
626 * set, NULL and false should be returned, respectively. Ergo, although
627 * the code below looks incorrect, it's actually right. */
628 if (filter_flags & FILTER_NULL_ON_FAILURE) {
630 } else {
631 RETURN_NULL();
632 }
633 }
634
636
637 php_filter_call(return_value, filter, filter_args_ht, filter_args_long, 1, FILTER_REQUIRE_SCALAR);
638}
639/* }}} */
640
641/* {{{ Returns the filtered version of the variable. */
643{
644 zend_long filter = FILTER_DEFAULT;
645 zval *data;
646 HashTable *filter_args_ht = NULL;
647 zend_long filter_args_long = 0;
648
652 Z_PARAM_LONG(filter)
653 Z_PARAM_ARRAY_HT_OR_LONG(filter_args_ht, filter_args_long)
655
656 if (!PHP_FILTER_ID_EXISTS(filter)) {
657 php_error_docref(NULL, E_WARNING, "Unknown filter with ID " ZEND_LONG_FMT, filter);
659 }
660
662
663 php_filter_call(return_value, filter, filter_args_ht, filter_args_long, 1, FILTER_REQUIRE_SCALAR);
664}
665/* }}} */
666
667/* {{{ Returns an array with all arguments defined in 'definition'. */
669{
670 zend_long fetch_from;
671 zval *array_input = NULL;
672 bool add_empty = 1;
673 HashTable *op_ht = NULL;
674 zend_long op_long = FILTER_DEFAULT;
675
677 Z_PARAM_LONG(fetch_from)
679 Z_PARAM_ARRAY_HT_OR_LONG(op_ht, op_long)
680 Z_PARAM_BOOL(add_empty)
682
683 if (!op_ht && !PHP_FILTER_ID_EXISTS(op_long)) {
684 php_error_docref(NULL, E_WARNING, "Unknown filter with ID " ZEND_LONG_FMT, op_long);
686 }
687
688 array_input = php_filter_get_storage(fetch_from);
689
690 if (EG(exception)) {
692 }
693
694 if (!array_input) {
695 RETURN_NULL();
696 }
697
698 php_filter_array_handler(array_input, op_ht, op_long, return_value, add_empty);
699}
700/* }}} */
701
702/* {{{ Returns an array with all arguments defined in 'definition'. */
704{
705 zval *array_input = NULL;
706 bool add_empty = 1;
707 HashTable *op_ht = NULL;
708 zend_long op_long = FILTER_DEFAULT;
709
711 Z_PARAM_ARRAY(array_input)
713 Z_PARAM_ARRAY_HT_OR_LONG(op_ht, op_long)
714 Z_PARAM_BOOL(add_empty)
716
717 if (!op_ht && !PHP_FILTER_ID_EXISTS(op_long)) {
718 php_error_docref(NULL, E_WARNING, "Unknown filter with ID " ZEND_LONG_FMT, op_long);
720 }
721
722 php_filter_array_handler(array_input, op_ht, op_long, return_value, add_empty);
723}
724/* }}} */
725
726/* {{{ Returns a list of all supported filters */
727PHP_FUNCTION(filter_list)
728{
729 int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
730
733 }
734
736 for (i = 0; i < size; ++i) {
737 add_next_index_string(return_value, (char *)filter_list[i].name);
738 }
739}
740/* }}} */
741
742/* {{{ Returns the filter ID belonging to a named filter */
744{
745 int i;
746 size_t filter_len;
747 int size = sizeof(filter_list) / sizeof(filter_list_entry);
748 char *filter;
749
750 if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filter, &filter_len) == FAILURE) {
752 }
753
754 for (i = 0; i < size; ++i) {
755 if (strcmp(filter_list[i].name, filter) == 0) {
756 RETURN_LONG(filter_list[i].id);
757 }
758 }
759
761}
762/* }}} */
SAPI_API int sapi_register_input_filter(unsigned int(*input_filter)(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int(*input_filter_init)(void))
Definition SAPI.c:991
bool exception
Definition assert.c:30
copy(string $from, string $to, $context=null)
assert(mixed $assertion, Throwable|string|null $description=null)
void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
zend_module_entry filter_module_entry
Definition filter.c:80
#define VAR_ARRAY_COPY_DTOR(a)
Definition filter.c:179
#define PARSE_CASE(s, a, t)
new_type size
Definition ffi.c:4365
zval * arg
Definition ffi.c:3975
zval * val
Definition ffi.c:4262
filter_id(string $name)
filter_input(int $type, string $var_name, int $filter=FILTER_DEFAULT, array|int $options=0)
filter_has_var(int $input_type, string $var_name)
filter_var(mixed $value, int $filter=FILTER_DEFAULT, array|int $options=0)
filter_var_array(array $array, array|int $options=FILTER_DEFAULT, bool $add_empty=true)
filter_input_array(int $type, array|int $options=FILTER_DEFAULT, bool $add_empty=true)
#define FILTER_VALIDATE_DOMAIN
#define FILTER_FLAG_NO_ENCODE_QUOTES
#define FILTER_SANITIZE_ENCODED
#define FILTER_REQUIRE_SCALAR
#define FILTER_VALIDATE_FLOAT
#define FILTER_SANITIZE_URL
#define FILTER_VALIDATE_URL
#define FILTER_SANITIZE_ADD_SLASHES
#define FILTER_VALIDATE_IP
#define FILTER_VALIDATE_INT
#define FILTER_SANITIZE_EMAIL
#define FILTER_UNSAFE_RAW
#define FILTER_VALIDATE_EMAIL
#define FILTER_VALIDATE_MAC
#define FILTER_FORCE_ARRAY
#define FILTER_DEFAULT
#define FILTER_VALIDATE_BOOL
#define FILTER_REQUIRE_ARRAY
#define FILTER_SANITIZE_SPECIAL_CHARS
#define FILTER_SANITIZE_FULL_SPECIAL_CHARS
#define FILTER_SANITIZE_NUMBER_INT
#define FILTER_NULL_ON_FAILURE
#define FILTER_CALLBACK
#define FILTER_SANITIZE_STRING
#define FILTER_SANITIZE_NUMBER_FLOAT
#define PHP_FILTER_ID_EXISTS(id)
#define FILTER_VALIDATE_REGEXP
#define NULL
Definition gdcache.h:45
#define SUCCESS
Definition hash_sha3.c:261
enum entity_charset charset
Definition html_tables.h:39
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
Definition main.c:1173
php_info_print_table_start()
Definition info.c:1064
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
Definition info.c:1074
#define PHP_FUNCTION
Definition php.h:364
#define PHP_MSHUTDOWN_FUNCTION
Definition php.h:401
#define PHP_MINFO
Definition php.h:396
#define PHP_MINIT_FUNCTION
Definition php.h:400
#define PHP_MSHUTDOWN
Definition php.h:393
#define PHP_MINFO_FUNCTION
Definition php.h:404
#define PHP_RSHUTDOWN
Definition php.h:395
#define PHP_RSHUTDOWN_FUNCTION
Definition php.h:403
#define PHP_MINIT
Definition php.h:392
void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL)
#define PHP_INPUT_FILTER_PARAM_DECL
Definition php_filter.h:58
zval env_array
Definition php_filter.h:43
void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL)
zval get_array
Definition php_filter.h:41
void php_filter_add_slashes(PHP_INPUT_FILTER_PARAM_DECL)
zval cookie_array
Definition php_filter.h:42
void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
#define IF_G(v)
Definition php_filter.h:56
void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL)
zval server_array
Definition php_filter.h:44
zval post_array
Definition php_filter.h:40
zend_long default_filter
Definition php_filter.h:48
zend_long default_filter_flags
Definition php_filter.h:49
#define PHP_FILTER_VERSION
Definition php_filter.h:31
#define TRACK_VARS_GET
Definition php_globals.h:41
#define TRACK_VARS_ENV
Definition php_globals.h:44
#define TRACK_VARS_POST
Definition php_globals.h:40
#define TRACK_VARS_SERVER
Definition php_globals.h:43
#define TRACK_VARS_COOKIE
Definition php_globals.h:42
#define PG(v)
Definition php_globals.h:31
#define PHP_INI_PERDIR
Definition php_ini.h:42
#define PHP_INI_BEGIN
Definition php_ini.h:52
#define STD_PHP_INI_ENTRY
Definition php_ini.h:64
#define PHP_INI_ENTRY
Definition php_ini.h:62
#define PHP_INI_MH
Definition php_ini.h:49
#define PHP_INI_SYSTEM
Definition php_ini.h:43
#define PHP_INI_END
Definition php_ini.h:53
PHP_JSON_API size_t int options
Definition php_json.h:102
PHPAPI void php_register_variable_ex(const char *var_name, zval *val, zval *track_vars_array)
#define PARSE_STRING
#define PARSE_SERVER
#define PARSE_COOKIE
#define PARSE_GET
#define PARSE_ENV
#define PARSE_POST
zend_constant * data
zend_function * __tostring
Definition zend.h:181
Definition filter.c:33
const char * name
Definition filter.c:34
int id
Definition filter.c:35
void(* function)(PHP_INPUT_FILTER_PARAM_DECL)
Definition filter.c:36
ZEND_API ZEND_COLD void zend_error(int type, const char *format,...)
Definition zend.c:1666
#define ZEND_TSRMLS_CACHE_UPDATE()
Definition zend.h:69
#define ZEND_TSRMLS_CACHE_DEFINE()
Definition zend.h:68
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
Definition zend_API.c:1300
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
Definition zend_API.c:433
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
Definition zend_API.c:423
ZEND_API zend_result add_next_index_string(zval *arg, const char *str)
Definition zend_API.c:2186
ZEND_API void add_assoc_null_ex(zval *arg, const char *key, size_t key_len)
Definition zend_API.c:1937
#define ZEND_NUM_ARGS()
Definition zend_API.h:530
#define ZEND_PARSE_PARAMETERS_END()
Definition zend_API.h:1641
#define RETURN_FALSE
Definition zend_API.h:1058
#define RETURN_NULL()
Definition zend_API.h:1036
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor)
Definition zend_API.h:272
#define ZEND_DECLARE_MODULE_GLOBALS(module_name)
Definition zend_API.h:268
#define Z_PARAM_OPTIONAL
Definition zend_API.h:1667
#define ZEND_GET_MODULE(name)
Definition zend_API.h:241
#define zend_parse_parameters_none()
Definition zend_API.h:353
#define Z_PARAM_STR(dest)
Definition zend_API.h:2086
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
Definition zend_API.h:1620
#define Z_PARAM_LONG(dest)
Definition zend_API.h:1896
#define RETURN_LONG(l)
Definition zend_API.h:1037
#define RETURN_THROWS()
Definition zend_API.h:1060
#define Z_PARAM_BOOL(dest)
Definition zend_API.h:1726
#define Z_PARAM_ARRAY(dest)
Definition zend_API.h:1682
#define Z_PARAM_ZVAL(dest)
Definition zend_API.h:2100
#define ZVAL_STRINGL(z, s, l)
Definition zend_API.h:952
#define RETURN_TRUE
Definition zend_API.h:1059
#define Z_PARAM_ARRAY_HT_OR_LONG(dest_ht, dest_long)
Definition zend_API.h:1866
#define array_init(arg)
Definition zend_API.h:537
#define ZVAL_EMPTY_STRING(z)
Definition zend_API.h:961
#define estrndup(s, length)
Definition zend_alloc.h:165
#define efree(ptr)
Definition zend_alloc.h:155
#define estrdup(s)
Definition zend_alloc.h:164
struct _zval_struct zval
strlen(string $string)
strcmp(string $string1, string $string2)
ZEND_API bool zend_is_auto_global(zend_string *name)
#define strcasecmp(s1, s2)
#define E_WARNING
Definition zend_errors.h:24
#define E_DEPRECATED
Definition zend_errors.h:37
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
#define EG(v)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
Definition zend_hash.c:2689
ZEND_API zval *ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key, zval *pData)
Definition zend_hash.c:997
ZEND_API zval *ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key)
Definition zend_hash.c:2668
#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val)
Definition zend_hash.h:1166
#define ZEND_HASH_FOREACH_END()
Definition zend_hash.h:1086
#define ZEND_HASH_FOREACH_VAL(ht, _val)
Definition zend_hash.h:1102
#define UNREGISTER_INI_ENTRIES()
Definition zend_ini.h:204
#define REGISTER_INI_ENTRIES()
Definition zend_ini.h:203
#define DISPLAY_INI_ENTRIES()
Definition zend_ini.h:205
int32_t zend_long
Definition zend_long.h:42
#define ZEND_LONG_FMT
Definition zend_long.h:87
struct _zend_string zend_string
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
#define convert_to_string(op)
struct _zend_class_entry zend_class_entry
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define ZSTR_KNOWN(idx)
#define ZSTR_LEN(zstr)
Definition zend_string.h:69
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define ZVAL_FALSE(z)
#define ZVAL_UNDEF(z)
#define ZVAL_DUP(z, v)
#define IS_FALSE
Definition zend_types.h:602
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
#define ZVAL_NULL(z)
#define ZVAL_DEREF(z)
struct _zend_array HashTable
Definition zend_types.h:386
#define IS_ARRAY
Definition zend_types.h:607
#define Z_ISUNDEF(zval)
Definition zend_types.h:956
#define Z_UNPROTECT_RECURSION_P(zv)
Definition zend_types.h:889
#define IS_NULL
Definition zend_types.h:601
#define Z_OBJCE_P(zval_p)
#define Z_STRVAL(zval)
Definition zend_types.h:974
@ FAILURE
Definition zend_types.h:61
#define Z_STRLEN(zval)
Definition zend_types.h:977
#define IS_OBJECT
Definition zend_types.h:608
#define ZVAL_COPY(z, v)
#define Z_PROTECT_RECURSION_P(zv)
Definition zend_types.h:888
#define SEPARATE_ARRAY(zv)
#define ZVAL_COPY_VALUE(z, v)
#define Z_IS_RECURSIVE_P(zv)
Definition zend_types.h:887
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
zval retval
zval * return_value
zend_string * name
value