Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

This commit was manufactured by cvs2svn to create tag 'RELEASE_1_0_4'.

  • Loading branch information...
commit 80b7d0980fea8f46a782a1dd75da7af43ba2596f 1 parent 79bebd9
SVN Migration authored

Showing 42 changed files with 0 additions and 2,993 deletions. Show diff stats Hide diff stats

  1. +0 2  ext/filter/CREDITS
  2. +0 68 ext/filter/callback_filter.c
  3. +0 95 ext/filter/config.m4
  4. +0 8 ext/filter/config.w32
  5. +0 680 ext/filter/filter.c
  6. +0 87 ext/filter/filter_private.h
  7. +0 53 ext/filter/package.xml
  8. +0 68 ext/filter/package2.xml
  9. +0 105 ext/filter/php_filter.h
  10. +0 340 ext/filter/sanitizing_filters.c
  11. +0 8 ext/filter/tests/001.phpt
  12. +0 11 ext/filter/tests/002.phpt
  13. +0 22 ext/filter/tests/003.phpt
  14. +0 24 ext/filter/tests/004.phpt
  15. +0 21 ext/filter/tests/005.phpt
  16. +0 10 ext/filter/tests/006.phpt
  17. +0 68 ext/filter/tests/007.phpt
  18. +0 88 ext/filter/tests/008.phpt
  19. +0 30 ext/filter/tests/009.phpt
  20. +0 60 ext/filter/tests/010.phpt
  21. +0 49 ext/filter/tests/011.phpt
  22. +0 16 ext/filter/tests/012.phpt
  23. +0 40 ext/filter/tests/013.phpt
  24. +0 41 ext/filter/tests/014.phpt
  25. +0 72 ext/filter/tests/015.phpt
  26. +0 32 ext/filter/tests/016.phpt
  27. +0 24 ext/filter/tests/017.phpt
  28. +0 50 ext/filter/tests/018.phpt
  29. +0 20 ext/filter/tests/019.phpt
  30. +0 18 ext/filter/tests/020.phpt
  31. +0 44 ext/filter/tests/021.phpt
  32. +0 20 ext/filter/tests/022.phpt
  33. +0 20 ext/filter/tests/023.phpt
  34. +0 18 ext/filter/tests/024.phpt
  35. +0 24 ext/filter/tests/025.phpt
  36. +0 30 ext/filter/tests/026.phpt
  37. +0 30 ext/filter/tests/027.phpt
  38. +0 35 ext/filter/tests/028.phpt
  39. +0 103 ext/filter/tests/029.phpt
  40. +0 71 ext/filter/tests/filter_data.phpt
  41. +0 103 ext/imap/imap.h
  42. +0 285 main/php_realpath.c
2  ext/filter/CREDITS
... ... @@ -1,2 +0,0 @@
1   -Input Filter
2   -Rasmus Lerdorf, Derick Rethans
68 ext/filter/callback_filter.c
... ... @@ -1,68 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2006 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   - | Authors: Derick Rethans <derick@php.net> |
16   - +----------------------------------------------------------------------+
17   -*/
18   -
19   -/* $Id$ */
20   -
21   -#include "php_filter.h"
22   -
23   -void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
24   -{
25   - char *name = NULL;
26   - zval *retval_ptr;
27   - zval ***args;
28   - int status;
29   -
30   - if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, &name)) {
31   - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
32   - if (name) {
33   - efree(name);
34   - }
35   - zval_dtor(value);
36   - Z_TYPE_P(value) = IS_NULL;
37   - return;
38   - }
39   - efree(name);
40   -
41   - args = safe_emalloc(sizeof(zval **), 1, 0);
42   - args[0] = &value;
43   -
44   - status = call_user_function_ex(EG(function_table), NULL, option_array, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
45   -
46   - if (status == SUCCESS && retval_ptr != NULL) {
47   - zval_dtor(value);
48   - *value = *retval_ptr;
49   - zval_copy_ctor(value);
50   - } else {
51   - zval_dtor(value);
52   - Z_TYPE_P(value) = IS_NULL;
53   - }
54   -
55   - if (retval_ptr) {
56   - zval_ptr_dtor(&retval_ptr);
57   - }
58   - efree(args);
59   -}
60   -
61   -/*
62   - * Local variables:
63   - * tab-width: 4
64   - * c-basic-offset: 4
65   - * End:
66   - * vim600: noet sw=4 ts=4 fdm=marker
67   - * vim<600: noet sw=4 ts=4
68   - */
95 ext/filter/config.m4
... ... @@ -1,95 +0,0 @@
1   -dnl $Id$
2   -dnl config.m4 for input filtering extension
3   -
4   -PHP_ARG_ENABLE(filter, whether to enable input filter support,
5   -[ --disable-filter Disable input filter support], yes)
6   -
7   -PHP_ARG_WITH(pcre-dir, pcre install prefix,
8   -[ --with-pcre-dir FILTER: pcre install prefix], no, no)
9   -
10   -if test "$PHP_FILTER" != "no"; then
11   -
12   - dnl Check if configure is the PHP core configure
13   - if test -n "$PHP_VERSION"; then
14   - dnl This extension can not be build as shared when in PHP core
15   - ext_shared=no
16   - else
17   - dnl This is PECL build, check if bundled PCRE library is used
18   - old_CPPFLAGS=$CPPFLAGS
19   - CPPFLAGS=$INCLUDES
20   - AC_EGREP_CPP(yes,[
21   -#include <main/php_config.h>
22   -#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
23   -yes
24   -#endif
25   - ],[
26   - PHP_PCRE_REGEX=yes
27   - ],[
28   - AC_EGREP_CPP(yes,[
29   -#include <main/php_config.h>
30   -#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
31   -yes
32   -#endif
33   - ],[
34   - PHP_PCRE_REGEX=pecl
35   - ],[
36   - PHP_PCRE_REGEX=no
37   - ])
38   - ])
39   - CPPFLAGS=$old_CPPFLAGS
40   - fi
41   -
42   - if test "$PHP_PCRE_REGEX" != "yes"; then
43   - dnl
44   - dnl If PCRE extension is enabled we can use the already found paths,
45   - dnl otherwise we have to detect them here:
46   - dnl
47   - if test "$PHP_PCRE_REGEX" = "no" || test "$PHP_PCRE_REGEX" = "pecl"; then
48   - dnl Set the PCRE search dirs correctly
49   - case "$PHP_PCRE_DIR" in
50   - yes|no)
51   - PCRE_SEARCH_DIR="/usr/local /usr"
52   - ;;
53   - *)
54   - PCRE_SEARCH_DIR="$PHP_PCRE_DIR"
55   - ;;
56   - esac
57   -
58   - for i in $PCRE_SEARCH_DIR; do
59   - if test -f $i/include/pcre/pcre.h; then
60   - PCRE_INCDIR=$i/include/pcre
61   - break
62   - elif test -f $i/include/pcre.h; then
63   - PCRE_INCDIR=$i/include
64   - break
65   - elif test -f $i/pcre.h; then
66   - PCRE_INCDIR=$i
67   - break
68   - fi
69   - done
70   -
71   - if test -z "$PCRE_INCDIR"; then
72   - AC_MSG_ERROR([Could not find pcre.h anywhere under $PCRE_SEARCH_DIR])
73   - fi
74   -
75   - for j in $PCRE_SEARCH_DIR/$PHP_LIBDIR $PCRE_SEARCH_DIR; do
76   - if test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME; then
77   - PCRE_LIBDIR=$j
78   - break
79   - fi
80   - done
81   -
82   - if test -z "$PCRE_LIBDIR" ; then
83   - AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) anywhere under $PCRE_SEARCH_DIR])
84   - fi
85   - fi
86   -
87   - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, FILTER_SHARED_LIBADD)
88   - PHP_ADD_INCLUDE($PCRE_INCDIR)
89   - fi
90   -
91   - PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
92   - PHP_SUBST(FILTER_SHARED_LIBADD)
93   -
94   - PHP_INSTALL_HEADERS([$ext_srcdir/php_filter.h])
95   -fi
8 ext/filter/config.w32
... ... @@ -1,8 +0,0 @@
1   -// $Id$
2   -// vim:ft=javascript
3   -
4   -ARG_ENABLE("filter", "Filter Support", "yes");
5   -
6   -if (PHP_FILTER == "yes") {
7   - EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
8   -}
680 ext/filter/filter.c
... ... @@ -1,680 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2006 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   - | Authors: Rasmus Lerdorf <rasmus@php.net> |
16   - | Derick Rethans <derick@php.net> |
17   - +----------------------------------------------------------------------+
18   -*/
19   -
20   -/* $Id$ */
21   -
22   -#ifdef HAVE_CONFIG_H
23   -#include "config.h"
24   -#endif
25   -
26   -#include "php_filter.h"
27   -
28   -ZEND_DECLARE_MODULE_GLOBALS(filter)
29   -
30   -#include "filter_private.h"
31   -
32   -typedef struct filter_list_entry {
33   - char *name;
34   - int id;
35   - void (*function)(PHP_INPUT_FILTER_PARAM_DECL);
36   -} filter_list_entry;
37   -
38   -filter_list_entry filter_list[] = {
39   - { "int", FL_INT, php_filter_int },
40   - { "boolean", FL_BOOLEAN, php_filter_boolean },
41   - { "float", FL_FLOAT, php_filter_float },
42   -
43   - { "validate_regexp", FL_REGEXP, php_filter_validate_regexp },
44   - { "validate_url", FL_URL, php_filter_validate_url },
45   - { "validate_email", FL_EMAIL, php_filter_validate_email },
46   - { "validate_ip", FL_IP, php_filter_validate_ip },
47   -
48   - { "string", FS_STRING, php_filter_string },
49   - { "stripped", FS_STRING, php_filter_string },
50   - { "encoded", FS_ENCODED, php_filter_encoded },
51   - { "special_chars", FS_SPECIAL_CHARS, php_filter_special_chars },
52   - { "unsafe_raw", FS_UNSAFE_RAW, php_filter_unsafe_raw },
53   - { "email", FS_EMAIL, php_filter_email },
54   - { "url", FS_URL, php_filter_url },
55   - { "number_int", FS_NUMBER_INT, php_filter_number_int },
56   - { "number_float", FS_NUMBER_FLOAT, php_filter_number_float },
57   - { "magic_quotes", FS_MAGIC_QUOTES, php_filter_magic_quotes },
58   -
59   - { "callback", FC_CALLBACK, php_filter_callback },
60   -};
61   -
62   -#ifndef PARSE_ENV
63   -#define PARSE_ENV 4
64   -#endif
65   -
66   -#ifndef PARSE_SERVER
67   -#define PARSE_SERVER 5
68   -#endif
69   -
70   -#ifndef PARSE_SESSION
71   -#define PARSE_SESSION 6
72   -#endif
73   -
74   -static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC);
75   -
76   -/* {{{ filter_functions[]
77   - */
78   -zend_function_entry filter_functions[] = {
79   - PHP_FE(input_get, NULL)
80   - PHP_FE(input_filters_list, NULL)
81   - PHP_FE(input_has_variable, NULL)
82   - PHP_FE(input_name_to_filter, NULL)
83   - PHP_FE(filter_data, NULL)
84   - {NULL, NULL, NULL}
85   -};
86   -/* }}} */
87   -
88   -/* {{{ filter_module_entry
89   - */
90   -zend_module_entry filter_module_entry = {
91   -#if ZEND_MODULE_API_NO >= 20010901
92   - STANDARD_MODULE_HEADER,
93   -#endif
94   - "filter",
95   - filter_functions,
96   - PHP_MINIT(filter),
97   - PHP_MSHUTDOWN(filter),
98   - NULL,
99   - PHP_RSHUTDOWN(filter),
100   - PHP_MINFO(filter),
101   - "0.9.3",
102   - STANDARD_MODULE_PROPERTIES
103   -};
104   -/* }}} */
105   -
106   -#ifdef COMPILE_DL_FILTER
107   -ZEND_GET_MODULE(filter)
108   -#endif
109   -
110   -/* {{{ UpdateDefaultFilter
111   - */
112   -static PHP_INI_MH(UpdateDefaultFilter)
113   -{
114   - int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
115   -
116   - for (i = 0; i < size; ++i) {
117   - if ((strcasecmp(new_value, filter_list[i].name) == 0)) {
118   - IF_G(default_filter) = filter_list[i].id;
119   - return SUCCESS;
120   - }
121   - }
122   - /* Fallback to "string" filter */
123   - IF_G(default_filter) = FS_DEFAULT;
124   - return SUCCESS;
125   -}
126   -/* }}} */
127   -
128   -/* {{{ PHP_INI
129   - */
130   -static PHP_INI_MH(OnUpdateFlags)
131   -{
132   - if (!new_value) {
133   - IF_G(default_filter_flags) = FILTER_FLAG_NO_ENCODE_QUOTES;
134   - } else {
135   - IF_G(default_filter_flags) = atoi(new_value);
136   - }
137   - return SUCCESS;
138   -}
139   -
140   -PHP_INI_BEGIN()
141   - STD_PHP_INI_ENTRY("filter.default", "string", PHP_INI_ALL, UpdateDefaultFilter, default_filter, zend_filter_globals, filter_globals)
142   - PHP_INI_ENTRY("filter.default_flags", NULL, PHP_INI_ALL, OnUpdateFlags)
143   -PHP_INI_END()
144   -/* }}} */
145   -
146   -/* {{{ php_filter_init_globals
147   -*/
148   -static void php_filter_init_globals(zend_filter_globals *filter_globals)
149   -{
150   - filter_globals->post_array = NULL;
151   - filter_globals->get_array = NULL;
152   - filter_globals->cookie_array = NULL;
153   - filter_globals->env_array = NULL;
154   - filter_globals->server_array = NULL;
155   - filter_globals->session_array = NULL;
156   - filter_globals->default_filter = FS_DEFAULT;
157   -}
158   -/* }}} */
159   -
160   -#define PARSE_REQUEST 99
161   -
162   -/* {{{ PHP_MINIT_FUNCTION
163   - */
164   -PHP_MINIT_FUNCTION(filter)
165   -{
166   - ZEND_INIT_MODULE_GLOBALS(filter, php_filter_init_globals, NULL);
167   -
168   - REGISTER_INI_ENTRIES();
169   -
170   - REGISTER_LONG_CONSTANT("INPUT_POST", PARSE_POST, CONST_CS | CONST_PERSISTENT);
171   - REGISTER_LONG_CONSTANT("INPUT_GET", PARSE_GET, CONST_CS | CONST_PERSISTENT);
172   - REGISTER_LONG_CONSTANT("INPUT_COOKIE", PARSE_COOKIE, CONST_CS | CONST_PERSISTENT);
173   - REGISTER_LONG_CONSTANT("INPUT_ENV", PARSE_ENV, CONST_CS | CONST_PERSISTENT);
174   - REGISTER_LONG_CONSTANT("INPUT_SERVER", PARSE_SERVER, CONST_CS | CONST_PERSISTENT);
175   - REGISTER_LONG_CONSTANT("INPUT_SESSION", PARSE_SESSION, CONST_CS | CONST_PERSISTENT);
176   -
177   - REGISTER_LONG_CONSTANT("FILTER_FLAG_NONE", FILTER_FLAG_NONE, CONST_CS | CONST_PERSISTENT);
178   -
179   - REGISTER_LONG_CONSTANT("FL_INT", FL_INT, CONST_CS | CONST_PERSISTENT);
180   - REGISTER_LONG_CONSTANT("FL_BOOLEAN", FL_BOOLEAN, CONST_CS | CONST_PERSISTENT);
181   - REGISTER_LONG_CONSTANT("FL_FLOAT", FL_FLOAT, CONST_CS | CONST_PERSISTENT);
182   -
183   - REGISTER_LONG_CONSTANT("FL_REGEXP", FL_REGEXP, CONST_CS | CONST_PERSISTENT);
184   - REGISTER_LONG_CONSTANT("FL_URL", FL_URL, CONST_CS | CONST_PERSISTENT);
185   - REGISTER_LONG_CONSTANT("FL_EMAIL", FL_EMAIL, CONST_CS | CONST_PERSISTENT);
186   - REGISTER_LONG_CONSTANT("FL_IP", FL_IP, CONST_CS | CONST_PERSISTENT);
187   -
188   - REGISTER_LONG_CONSTANT("FS_DEFAULT", FS_DEFAULT, CONST_CS | CONST_PERSISTENT);
189   - REGISTER_LONG_CONSTANT("FS_STRING", FS_STRING, CONST_CS | CONST_PERSISTENT);
190   - REGISTER_LONG_CONSTANT("FS_STRIPPED", FS_STRING, CONST_CS | CONST_PERSISTENT);
191   - REGISTER_LONG_CONSTANT("FS_ENCODED", FS_ENCODED, CONST_CS | CONST_PERSISTENT);
192   - REGISTER_LONG_CONSTANT("FS_SPECIAL_CHARS", FS_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT);
193   - REGISTER_LONG_CONSTANT("FS_UNSAFE_RAW", FS_UNSAFE_RAW, CONST_CS | CONST_PERSISTENT);
194   - REGISTER_LONG_CONSTANT("FS_EMAIL", FS_EMAIL, CONST_CS | CONST_PERSISTENT);
195   - REGISTER_LONG_CONSTANT("FS_URL", FS_URL, CONST_CS | CONST_PERSISTENT);
196   - REGISTER_LONG_CONSTANT("FS_NUMBER_INT", FS_NUMBER_INT, CONST_CS | CONST_PERSISTENT);
197   - REGISTER_LONG_CONSTANT("FS_NUMBER_FLOAT", FS_NUMBER_FLOAT, CONST_CS | CONST_PERSISTENT);
198   - REGISTER_LONG_CONSTANT("FS_MAGIC_QUOTES", FS_MAGIC_QUOTES, CONST_CS | CONST_PERSISTENT);
199   - REGISTER_LONG_CONSTANT("FC_CALLBACK", FC_CALLBACK, CONST_CS | CONST_PERSISTENT);
200   -
201   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_OCTAL", FILTER_FLAG_ALLOW_OCTAL, CONST_CS | CONST_PERSISTENT);
202   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_HEX", FILTER_FLAG_ALLOW_HEX, CONST_CS | CONST_PERSISTENT);
203   -
204   - REGISTER_LONG_CONSTANT("FILTER_FLAG_STRIP_LOW", FILTER_FLAG_STRIP_LOW, CONST_CS | CONST_PERSISTENT);
205   - REGISTER_LONG_CONSTANT("FILTER_FLAG_STRIP_HIGH", FILTER_FLAG_STRIP_HIGH, CONST_CS | CONST_PERSISTENT);
206   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_LOW", FILTER_FLAG_ENCODE_LOW, CONST_CS | CONST_PERSISTENT);
207   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_HIGH", FILTER_FLAG_ENCODE_HIGH, CONST_CS | CONST_PERSISTENT);
208   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_AMP", FILTER_FLAG_ENCODE_AMP, CONST_CS | CONST_PERSISTENT);
209   - REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_ENCODE_QUOTES", FILTER_FLAG_NO_ENCODE_QUOTES, CONST_CS | CONST_PERSISTENT);
210   - REGISTER_LONG_CONSTANT("FILTER_FLAG_EMPTY_STRING_NULL", FILTER_FLAG_EMPTY_STRING_NULL, CONST_CS | CONST_PERSISTENT);
211   -
212   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_FRACTION", FILTER_FLAG_ALLOW_FRACTION, CONST_CS | CONST_PERSISTENT);
213   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_THOUSAND", FILTER_FLAG_ALLOW_THOUSAND, CONST_CS | CONST_PERSISTENT);
214   - REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_SCIENTIFIC", FILTER_FLAG_ALLOW_SCIENTIFIC, CONST_CS | CONST_PERSISTENT);
215   -
216   - REGISTER_LONG_CONSTANT("FILTER_FLAG_SCHEME_REQUIRED", FILTER_FLAG_SCHEME_REQUIRED, CONST_CS | CONST_PERSISTENT);
217   - REGISTER_LONG_CONSTANT("FILTER_FLAG_HOST_REQUIRED", FILTER_FLAG_HOST_REQUIRED, CONST_CS | CONST_PERSISTENT);
218   - REGISTER_LONG_CONSTANT("FILTER_FLAG_PATH_REQUIRED", FILTER_FLAG_PATH_REQUIRED, CONST_CS | CONST_PERSISTENT);
219   - REGISTER_LONG_CONSTANT("FILTER_FLAG_QUERY_REQUIRED", FILTER_FLAG_QUERY_REQUIRED, CONST_CS | CONST_PERSISTENT);
220   -
221   - REGISTER_LONG_CONSTANT("FILTER_FLAG_IPV4", FILTER_FLAG_IPV4, CONST_CS | CONST_PERSISTENT);
222   - REGISTER_LONG_CONSTANT("FILTER_FLAG_IPV6", FILTER_FLAG_IPV6, CONST_CS | CONST_PERSISTENT);
223   - REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_RES_RANGE", FILTER_FLAG_NO_RES_RANGE, CONST_CS | CONST_PERSISTENT);
224   - REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_PRIV_RANGE", FILTER_FLAG_NO_PRIV_RANGE, CONST_CS | CONST_PERSISTENT);
225   -
226   - sapi_register_input_filter(php_sapi_filter);
227   - return SUCCESS;
228   -}
229   -/* }}} */
230   -
231   -/* {{{ PHP_MSHUTDOWN_FUNCTION
232   - */
233   -PHP_MSHUTDOWN_FUNCTION(filter)
234   -{
235   - UNREGISTER_INI_ENTRIES();
236   -
237   - return SUCCESS;
238   -}
239   -/* }}} */
240   -
241   -/* {{{ PHP_RSHUTDOWN_FUNCTION
242   - */
243   -#define VAR_ARRAY_COPY_DTOR(a) \
244   - if (IF_G(a)) { \
245   - zval_ptr_dtor(&IF_G(a)); \
246   - IF_G(a) = NULL; \
247   - }
248   -PHP_RSHUTDOWN_FUNCTION(filter)
249   -{
250   - VAR_ARRAY_COPY_DTOR(get_array)
251   - VAR_ARRAY_COPY_DTOR(post_array)
252   - VAR_ARRAY_COPY_DTOR(cookie_array)
253   - VAR_ARRAY_COPY_DTOR(server_array)
254   - VAR_ARRAY_COPY_DTOR(env_array)
255   - VAR_ARRAY_COPY_DTOR(session_array)
256   - return SUCCESS;
257   -}
258   -/* }}} */
259   -
260   -/* {{{ PHP_MINFO_FUNCTION
261   - */
262   -PHP_MINFO_FUNCTION(filter)
263   -{
264   - php_info_print_table_start();
265   - php_info_print_table_row( 2, "Input Validation and Filtering", "enabled" );
266   - php_info_print_table_row( 2, "Revision", "$Revision$");
267   - php_info_print_table_end();
268   -
269   - DISPLAY_INI_ENTRIES();
270   -}
271   -/* }}} */
272   -
273   -static filter_list_entry php_find_filter(long id)
274   -{
275   - int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
276   -
277   - for (i = 0; i < size; ++i) {
278   - if (filter_list[i].id == id) {
279   - return filter_list[i];
280   - }
281   - }
282   - /* Fallback to "string" filter */
283   - for (i = 0; i < size; ++i) {
284   - if (filter_list[i].id == FS_DEFAULT) {
285   - return filter_list[i];
286   - }
287   - }
288   - /* To shut up GCC */
289   - return filter_list[0];
290   -}
291   -
292   -static void php_zval_filter(zval *value, long filter, long flags, zval *options, char* charset TSRMLS_DC)
293   -{
294   - filter_list_entry filter_func;
295   -
296   - filter_func = php_find_filter(filter);
297   -
298   - if (!filter_func.id) {
299   - /* Find default filter */
300   - filter_func = php_find_filter(FS_DEFAULT);
301   - }
302   -
303   - /* Here be strings */
304   - convert_to_string(value);
305   -
306   - filter_func.function(value, flags, options, charset TSRMLS_CC);
307   -}
308   -
309   -/* {{{ php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned *new_val_len)
310   - */
311   -static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)
312   -{
313   - zval new_var, raw_var;
314   - zval *array_ptr = NULL, *orig_array_ptr = NULL;
315   - char *orig_var;
316   - int retval = 0;
317   -
318   - assert(*val != NULL);
319   -
320   -#define PARSE_CASE(s,a,t) \
321   - case s: \
322   - if (!IF_G(a)) { \
323   - ALLOC_ZVAL(array_ptr); \
324   - array_init(array_ptr); \
325   - INIT_PZVAL(array_ptr); \
326   - IF_G(a) = array_ptr; \
327   - } else { \
328   - array_ptr = IF_G(a); \
329   - } \
330   - orig_array_ptr = PG(http_globals)[t]; \
331   - break;
332   -
333   - switch (arg) {
334   - PARSE_CASE(PARSE_POST, post_array, TRACK_VARS_POST)
335   - PARSE_CASE(PARSE_GET, get_array, TRACK_VARS_GET)
336   - PARSE_CASE(PARSE_COOKIE, cookie_array, TRACK_VARS_COOKIE)
337   - PARSE_CASE(PARSE_SERVER, server_array, TRACK_VARS_SERVER)
338   - PARSE_CASE(PARSE_ENV, env_array, TRACK_VARS_ENV)
339   -
340   - case PARSE_STRING: /* PARSE_STRING is used by parse_str() function */
341   - retval = 1;
342   - break;
343   - }
344   -
345   - if (array_ptr) {
346   - /* Make a copy of the variable name, as php_register_variable_ex seems to
347   - * modify it */
348   - orig_var = estrdup(var);
349   -
350   - /* Store the RAW variable internally */
351   - /* FIXME: Should not use php_register_variable_ex as that also registers
352   - * globals when register_globals is turned on */
353   - Z_STRLEN(raw_var) = val_len;
354   - Z_STRVAL(raw_var) = estrndup(*val, val_len + 1);
355   - Z_TYPE(raw_var) = IS_STRING;
356   -
357   - php_register_variable_ex(var, &raw_var, array_ptr TSRMLS_CC);
358   - }
359   -
360   - /* Register mangled variable */
361   - /* FIXME: Should not use php_register_variable_ex as that also registers
362   - * globals when register_globals is turned on */
363   - Z_STRLEN(new_var) = val_len;
364   - Z_STRVAL(new_var) = estrndup(*val, val_len + 1);
365   - Z_TYPE(new_var) = IS_STRING;
366   -
367   - if (val_len) {
368   - if (! (IF_G(default_filter) == FS_UNSAFE_RAW)) {
369   - php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL/*charset*/ TSRMLS_CC);
370   - }
371   - }
372   -
373   - if (orig_array_ptr) {
374   - php_register_variable_ex(orig_var, &new_var, orig_array_ptr TSRMLS_CC);
375   - efree(orig_var);
376   - }
377   -
378   - if (retval) {
379   - if (new_val_len) {
380   - *new_val_len = Z_STRLEN(new_var);
381   - }
382   - efree(*val);
383   - if (Z_STRLEN(new_var)) {
384   - *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var) + 1);
385   - zval_dtor(&new_var);
386   - } else {
387   - *val = estrdup("");
388   - }
389   - }
390   -
391   - return retval;
392   -}
393   -/* }}} */
394   -
395   -/* {{{ static void php_zval_filter_recursive(zval *array, long filter, long flags, char *charset TSRMLS_DC)
396   - */
397   -static void php_zval_filter_recursive(zval *value, long filter, long flags, zval *options, char *charset TSRMLS_DC)
398   -{
399   - zval **element;
400   - HashPosition pos;
401   -
402   - if (Z_TYPE_P(value) == IS_ARRAY) {
403   - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(value), &pos);
404   - zend_hash_get_current_data_ex(Z_ARRVAL_P(value), (void **) &element, &pos) == SUCCESS;
405   - zend_hash_move_forward_ex(Z_ARRVAL_P(value), &pos)) {
406   - php_zval_filter_recursive(*element, filter, flags, options, charset TSRMLS_CC);
407   - }
408   - } else {
409   - php_zval_filter(value, filter, flags, options, charset TSRMLS_CC);
410   - }
411   -}
412   -/* }}} */
413   -
414   -#define FIND_SOURCE(a,t) \
415   - array_ptr = IF_G(a); \
416   - break;
417   -
418   -/* {{{ proto mixed input_has_variable(constant type, string variable_name)
419   - */
420   -PHP_FUNCTION(input_has_variable)
421   -{
422   - long arg;
423   - char *var;
424   - int var_len;
425   - zval **tmp;
426   - zval *array_ptr = NULL;
427   - HashTable *hash_ptr;
428   - int found = 0;
429   -
430   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
431   - return;
432   - }
433   -
434   - switch (arg) {
435   - case PARSE_GET: FIND_SOURCE(get_array, TRACK_VARS_GET)
436   - case PARSE_POST: FIND_SOURCE(post_array, TRACK_VARS_POST)
437   - case PARSE_COOKIE: FIND_SOURCE(cookie_array, TRACK_VARS_COOKIE)
438   - case PARSE_SERVER: FIND_SOURCE(server_array, TRACK_VARS_SERVER)
439   - case PARSE_ENV: FIND_SOURCE(env_array, TRACK_VARS_ENV)
440   - }
441   -
442   - if (!array_ptr) {
443   - RETURN_FALSE;
444   - }
445   -
446   - if (!found) {
447   - hash_ptr = HASH_OF(array_ptr);
448   -
449   - if (hash_ptr && zend_hash_find(hash_ptr, var, var_len + 1, (void **)&tmp) == SUCCESS) {
450   - RETURN_TRUE;
451   - }
452   - }
453   -
454   - RETURN_FALSE;
455   -}
456   -/* }}} */
457   -
458   -/* {{{ proto mixed input_get(constant type, string variable_name [, int filter [, mixed flags [, string charset]]])
459   - */
460   -PHP_FUNCTION(input_get)
461   -{
462   - long arg, filter = FS_DEFAULT;
463   - char *var, *charset = NULL;
464   - int var_len, charset_len;
465   - zval *flags = NULL;
466   - zval **tmp;
467   - zval *array_ptr = NULL, *array_ptr2 = NULL, *array_ptr3 = NULL;
468   - HashTable *hash_ptr;
469   - int found = 0;
470   - int filter_flags = 0;
471   - zval *options = NULL;
472   -
473   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|lzs", &arg, &var, &var_len, &filter, &flags, &charset, &charset_len) == FAILURE) {
474   - return;
475   - }
476   -
477   - if (flags) {
478   - switch (Z_TYPE_P(flags)) {
479   - case IS_ARRAY:
480   - options = flags;
481   - break;
482   -
483   - case IS_STRING:
484   - case IS_BOOL:
485   - case IS_LONG:
486   - convert_to_long(flags);
487   - filter_flags = Z_LVAL_P(flags);
488   - options = NULL;
489   - break;
490   - }
491   - }
492   -
493   - switch(arg) {
494   - case PARSE_GET: FIND_SOURCE(get_array, TRACK_VARS_GET)
495   - case PARSE_POST: FIND_SOURCE(post_array, TRACK_VARS_POST)
496   - case PARSE_COOKIE: FIND_SOURCE(cookie_array, TRACK_VARS_COOKIE)
497   - case PARSE_SERVER: FIND_SOURCE(server_array, TRACK_VARS_SERVER)
498   - case PARSE_ENV: FIND_SOURCE(env_array, TRACK_VARS_ENV)
499   -
500   - case PARSE_SESSION:
501   - /* FIXME: Implement session source */
502   - break;
503   -
504   - case PARSE_REQUEST:
505   - if (PG(variables_order)) {
506   - zval **a_ptr = &array_ptr;
507   - char *p, *variables_order = PG(variables_order);
508   -
509   - for (p = variables_order; p && *p; p++) {
510   - switch (*p) {
511   - case 'p':
512   - case 'P':
513   - if (IF_G(default_filter) != FS_UNSAFE_RAW) {
514   - *a_ptr = IF_G(post_array);
515   - } else {
516   - *a_ptr = PG(http_globals)[TRACK_VARS_POST];
517   - }
518   - break;
519   - case 'g':
520   - case 'G':
521   - if (IF_G(default_filter) != FS_UNSAFE_RAW) {
522   - *a_ptr = IF_G(get_array);
523   - } else {
524   - *a_ptr = PG(http_globals)[TRACK_VARS_GET];
525   - }
526   - break;
527   - case 'c':
528   - case 'C':
529   - if (IF_G(default_filter) != FS_UNSAFE_RAW) {
530   - *a_ptr = IF_G(cookie_array);
531   - } else {
532   - *a_ptr = PG(http_globals)[TRACK_VARS_COOKIE];
533   - }
534   - break;
535   - }
536   - if (array_ptr && !array_ptr2) {
537   - a_ptr = &array_ptr2;
538   - continue;
539   - }
540   - if (array_ptr2 && !array_ptr3) {
541   - a_ptr = &array_ptr3;
542   - }
543   - }
544   - } else {
545   - FIND_SOURCE(get_array, TRACK_VARS_GET)
546   - }
547   -
548   - }
549   -
550   - if (!array_ptr) {
551   - RETURN_FALSE;
552   - }
553   -
554   - if (array_ptr3) {
555   - hash_ptr = HASH_OF(array_ptr3);
556   - if (hash_ptr && zend_hash_find(hash_ptr, var, var_len + 1, (void **)&tmp) == SUCCESS) {
557   - *return_value = **tmp;
558   - found = 1;
559   - }
560   - }
561   -
562   - if (array_ptr2 && !found) {
563   - hash_ptr = HASH_OF(array_ptr2);
564   - if (hash_ptr && zend_hash_find(hash_ptr, var, var_len + 1, (void **)&tmp) == SUCCESS) {
565   - *return_value = **tmp;
566   - found = 1;
567   - }
568   - }
569   -
570   - if (!found) {
571   - hash_ptr = HASH_OF(array_ptr);
572   -
573   - if (hash_ptr && zend_hash_find(hash_ptr, var, var_len + 1, (void **)&tmp) == SUCCESS) {
574   - *return_value = **tmp;
575   - found = 1;
576   - }
577   - }
578   -
579   - if (found) {
580   - zval_copy_ctor(return_value); /* Watch out for empty strings */
581   - php_zval_filter_recursive(return_value, filter, filter_flags, options, charset TSRMLS_CC);
582   - } else {
583   - RETVAL_FALSE;
584   - }
585   -}
586   -/* }}} */
587   -
588   -/* {{{ proto input_filters_list()
589   - * Returns a list of all supported filters */
590   -PHP_FUNCTION(input_filters_list)
591   -{
592   - int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
593   -
594   - array_init(return_value);
595   - for (i = 0; i < size; ++i) {
596   - add_next_index_string(return_value, filter_list[i].name, 1);
597   - }
598   -}
599   -/* }}} */
600   -
601   -/* {{{ proto input_name_to_filter(string filtername)
602   - * Returns the filter ID belonging to a named filter */
603   -PHP_FUNCTION(input_name_to_filter)
604   -{
605   - int i, filter_len;
606   - int size = sizeof(filter_list) / sizeof(filter_list_entry);
607   - char *filter;
608   -
609   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filter, &filter_len) == FAILURE) {
610   - return;
611   - }
612   -
613   - for (i = 0; i < size; ++i) {
614   - if (strcmp(filter_list[i].name, filter) == 0) {
615   - RETURN_LONG(filter_list[i].id);
616   - }
617   - }
618   - RETURN_NULL();
619   -}
620   -/* }}} */
621   -
622   -/* {{{ proto filter_data(mixed variable, int filter [, mixed filter_options [, string charset ]])
623   - */
624   -PHP_FUNCTION(filter_data)
625   -{
626   - long filter = FS_DEFAULT;
627   - char *charset = NULL;
628   - int charset_len;
629   - zval *var, *flags = NULL;
630   - int filter_flags = 0;
631   - zval *options = NULL;
632   -
633   - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/l|zs", &var, &filter, &flags, &charset, &charset_len) == FAILURE) {
634   - return;
635   - }
636   -
637   - if (filter != FC_CALLBACK) {
638   - if (flags) {
639   - switch (Z_TYPE_P(flags)) {
640   - case IS_ARRAY:
641   - options = flags;
642   - break;
643   -
644   - case IS_STRING:
645   - case IS_BOOL:
646   - case IS_LONG:
647   - convert_to_long(flags);
648   - filter_flags = Z_LVAL_P(flags);
649   - options = NULL;
650   - break;
651   - }
652   - }
653   - } else {
654   - if (flags) {
655   - switch (Z_TYPE_P(flags)) {
656   - case IS_ARRAY:
657   - case IS_STRING:
658   - options = flags;
659   - break;
660   -
661   - default:
662   - convert_to_string(flags);
663   - options = flags;
664   - break;
665   - }
666   - }
667   - }
668   - php_zval_filter_recursive(var, filter, filter_flags, options, charset TSRMLS_CC);
669   - RETURN_ZVAL(var, 1, 0);
670   -}
671   -/* }}} */
672   -
673   -/*
674   - * Local variables:
675   - * tab-width: 4
676   - * c-basic-offset: 4
677   - * End:
678   - * vim600: noet sw=4 ts=4 fdm=marker
679   - * vim<600: noet sw=4 ts=4
680   - */
87 ext/filter/filter_private.h
... ... @@ -1,87 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2006 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   - | Authors: Derick Rethans <derick@php.net> |
16   - +----------------------------------------------------------------------+
17   -*/
18   -
19   -/* $Id$ */
20   -
21   -#ifndef FILTER_PRIVATE_H
22   -#define FILTER_PRIVATE_H
23   -
24   -#define FILTER_FLAG_NONE 0x0000
25   -
26   -#define FILTER_FLAG_ALLOW_OCTAL 0x0001
27   -#define FILTER_FLAG_ALLOW_HEX 0x0002
28   -
29   -#define FILTER_FLAG_STRIP_LOW 0x0004
30   -#define FILTER_FLAG_STRIP_HIGH 0x0008
31   -#define FILTER_FLAG_ENCODE_LOW 0x0010
32   -#define FILTER_FLAG_ENCODE_HIGH 0x0020
33   -#define FILTER_FLAG_ENCODE_AMP 0x0040
34   -#define FILTER_FLAG_NO_ENCODE_QUOTES 0x0080
35   -#define FILTER_FLAG_EMPTY_STRING_NULL 0x0100
36   -
37   -#define FILTER_FLAG_ALLOW_FRACTION 0x1000
38   -#define FILTER_FLAG_ALLOW_THOUSAND 0x2000
39   -#define FILTER_FLAG_ALLOW_SCIENTIFIC 0x4000
40   -
41   -#define FILTER_FLAG_SCHEME_REQUIRED 0x010000
42   -#define FILTER_FLAG_HOST_REQUIRED 0x020000
43   -#define FILTER_FLAG_PATH_REQUIRED 0x040000
44   -#define FILTER_FLAG_QUERY_REQUIRED 0x080000
45   -
46   -#define FILTER_FLAG_IPV4 0x100000
47   -#define FILTER_FLAG_IPV6 0x200000
48   -#define FILTER_FLAG_NO_RES_RANGE 0x400000
49   -#define FILTER_FLAG_NO_PRIV_RANGE 0x800000
50   -
51   -#define FL_INT 0x0101
52   -#define FL_BOOLEAN 0x0102
53   -#define FL_FLOAT 0x0103
54   -
55   -#define FL_REGEXP 0x0110
56   -#define FL_URL 0x0111
57   -#define FL_EMAIL 0x0112
58   -#define FL_IP 0x0113
59   -
60   -#define FL_ALL 0x0100
61   -
62   -#define FS_DEFAULT 0x0201
63   -
64   -#define FS_STRING 0x0201
65   -#define FS_ENCODED 0x0202
66   -#define FS_SPECIAL_CHARS 0x0203
67   -#define FS_UNSAFE_RAW 0x0204
68   -#define FS_EMAIL 0x0205
69   -#define FS_URL 0x0206
70   -#define FS_NUMBER_INT 0x0207
71   -#define FS_NUMBER_FLOAT 0x0208
72   -#define FS_MAGIC_QUOTES 0x0209
73   -
74   -#define FS_ALL 0x0200
75   -
76   -#define FC_CALLBACK 0x0400
77   -
78   -#endif /* FILTER_PRIVATE_H */
79   -
80   -/*
81   - * Local variables:
82   - * tab-width: 4
83   - * c-basic-offset: 4
84   - * End:
85   - * vim600: noet sw=4 ts=4 fdm=marker
86   - * vim<600: noet sw=4 ts=4
87   - */
53 ext/filter/package.xml
... ... @@ -1,53 +0,0 @@
1   -<?xml version="1.0" encoding="ISO-8859-1" ?>
2   -<!DOCTYPE package SYSTEM "../pear/package.dtd">
3   -<package>
4   - <name>filter</name>
5   - <summary>Extension for safely dealing with input parameters</summary>
6   - <maintainers>
7   - <maintainer>
8   - <user>derick</user>
9   - <name>Derick Rethans</name>
10   - <email>derick@php.net</email>
11   - <role>lead</role>
12   - </maintainer>
13   - <maintainer>
14   - <user>rasmus</user>
15   - <name>Rasmus Lerdorf</name>
16   - <email>rasmus@php.net</email>
17   - <role>lead</role>
18   - </maintainer>
19   - </maintainers>
20   - <description>
21   -The Input Filter extension is meant to address this issue by implementing a set
22   -of filters and mechanisms that users can use to safely access their input data.
23   - </description>
24   - <license>PHP</license>
25   - <release>
26   - <state>beta</state>
27   - <version>0.9.3</version>
28   - <date>2005-11-18</date>
29   - <notes>
30   -- Fixed PECL bug #5960: Build with PHP's PCRE headers
31   -- Fixed PECL bug #5962: Postive float returned when negative float given
32   -- Fixed PECL bug #5963: Segmentation fault when passing anything other than strings
33   -
34   -- Added PECL FR #5961: Support other cases of "On", "Off", "True", and "False"
35   - </notes>
36   - <filelist>
37   - <file role="src" name="config.m4"/>
38   - <file role="src" name="config.w32"/>
39   - <file role="src" name="filter.c"/>
40   - <file role="src" name="filter_private.h"/>
41   - <file role="src" name="callback_filter.c"/>
42   - <file role="src" name="logical_filters.c"/>
43   - <file role="src" name="sanitizing_filters.c"/>
44   - <file role="src" name="php_filter.h"/>
45   - <file role="doc" name="CREDITS"/>
46   - </filelist>
47   - <deps>
48   - </deps>
49   - </release>
50   -</package>
51   -<!--
52   -vim:et:ts=1:sw=1
53   --->
68 ext/filter/package2.xml
... ... @@ -1,68 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<package packagerversion="1.4.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
3   -http://pear.php.net/dtd/tasks-1.0.xsd
4   -http://pear.php.net/dtd/package-2.0
5   -http://pear.php.net/dtd/package-2.0.xsd">
6   - <name>filter</name>
7   - <channel>pecl.php.net</channel>
8   - <summary>Extension for safely dealing with input parameters</summary>
9   - <description>The Input Filter extension is meant to address this issue by implementing a set
10   -of filters and mechanisms that users can use to safely access their input data.
11   -
12   - </description>
13   - <lead>
14   - <name>Derick Rethans</name>
15   - <user>derick</user>
16   - <email>derick@php.net</email>
17   - <active>yes</active>
18   - </lead>
19   - <lead>
20   - <name>Rasmus Lerdorf</name>
21   - <user>rasmus</user>
22   - <email>rasmus@php.net</email>
23   - <active>yes</active>
24   - </lead>
25   - <date>2005-11-18</date>
26   - <time>10:55:41</time>
27   - <version>
28   - <release>0.9.3</release>
29   - <api>0.9.3</api>
30   - </version>
31   - <stability>
32   - <release>beta</release>
33   - <api>beta</api>
34   - </stability>
35   - <license uri="http://www.php.net/license">PHP</license>
36   - <notes>- Fixed PECL bug #5960: Build with PHP&apos;s PCRE headers
37   -- Fixed PECL bug #5962: Postive float returned when negative float given
38   -- Fixed PECL bug #5963: Segmentation fault when passing anything other than strings
39   -
40   -- Added PECL FR #5961: Support other cases of &quot;On&quot;, &quot;Off&quot;, &quot;True&quot;, and &quot;False&quot;
41   -
42   - </notes>
43   - <contents>
44   - <dir name="/">
45   - <file name="callback_filter.c" role="src" />
46   - <file name="config.m4" role="src" />
47   - <file name="config.w32" role="src" />
48   - <file name="CREDITS" role="doc" />
49   - <file name="filter.c" role="src" />
50   - <file name="filter_private.h" role="src" />
51   - <file name="logical_filters.c" role="src" />
52   - <file name="php_filter.h" role="src" />
53   - <file name="sanitizing_filters.c" role="src" />
54   - </dir> <!-- / -->
55   - </contents>
56   - <dependencies>
57   - <required>
58   - <php>
59   - <min>4.0.0</min>
60   - </php>
61   - <pearinstaller>
62   - <min>1.4.0b1</min>
63   - </pearinstaller>
64   - </required>
65   - </dependencies>
66   - <providesextension>filter</providesextension>
67   - <extsrcrelease />
68   -</package>
105 ext/filter/php_filter.h
... ... @@ -1,105 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2006 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   - | Authors: Rasmus Lerdorf <rasmus@php.net> |
16   - | Derick Rethans <derick@php.net> |
17   - +----------------------------------------------------------------------+
18   -*/
19   -
20   -/* $Id$ */
21   -
22   -#ifndef PHP_FILTER_H
23   -#define PHP_FILTER_H
24   -
25   -#include "SAPI.h"
26   -#include "zend_API.h"
27   -#include "php.h"
28   -#include "php_ini.h"
29   -#include "ext/standard/info.h"
30   -#include "ext/standard/php_string.h"
31   -#include "php_variables.h"
32   -
33   -extern zend_module_entry filter_module_entry;
34   -#define phpext_filter_ptr &filter_module_entry
35   -
36   -#ifdef PHP_WIN32
37   -#define PHP_FILTER_API __declspec(dllexport)
38   -#else
39   -#define PHP_FILTER_API
40   -#endif
41   -
42   -#ifdef ZTS
43   -#include "TSRM.h"
44   -#endif
45   -
46   -PHP_MINIT_FUNCTION(filter);
47   -PHP_MSHUTDOWN_FUNCTION(filter);
48   -PHP_RINIT_FUNCTION(filter);
49   -PHP_RSHUTDOWN_FUNCTION(filter);
50   -PHP_MINFO_FUNCTION(filter);
51   -
52   -PHP_FUNCTION(input_get);
53   -PHP_FUNCTION(input_filters_list);
54   -PHP_FUNCTION(input_has_variable);
55   -PHP_FUNCTION(input_name_to_filter);
56   -PHP_FUNCTION(filter_data);
57   -
58   -ZEND_BEGIN_MODULE_GLOBALS(filter)
59   - zval *post_array;
60   - zval *get_array;
61   - zval *cookie_array;
62   - zval *env_array;
63   - zval *server_array;
64   - zval *session_array;
65   - long default_filter;
66   - long default_filter_flags;
67   -ZEND_END_MODULE_GLOBALS(filter)
68   -
69   -#ifdef ZTS
70   -#define IF_G(v) TSRMG(filter_globals_id, zend_filter_globals *, v)
71   -#else
72   -#define IF_G(v) (filter_globals.v)
73   -#endif
74   -
75   -
76   -#define PHP_INPUT_FILTER_PARAM_DECL zval *value, long flags, zval *option_array, char *charset TSRMLS_DC
77   -void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL);
78   -void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL);
79   -void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL);
80   -void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL);
81   -void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL);
82   -void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL);
83   -void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL);
84   -
85   -void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL);
86   -void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL);
87   -void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL);
88   -void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL);
89   -void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL);
90   -void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL);
91   -void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL);
92   -void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL);
93   -void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL);
94   -
95   -void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL);
96   -
97   -#endif /* FILTER_H */
98   -
99   -/*
100   - * Local variables:
101   - * tab-width: 4
102   - * c-basic-offset: 4
103   - * indent-tabs-mode: t
104   - * End:
105   - */
340 ext/filter/sanitizing_filters.c
... ... @@ -1,340 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 5 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2006 The PHP Group |