From 0907893b2b04b3f39f3cc1a19444a6a9701d1323 Mon Sep 17 00:00:00 2001 From: foobar Date: Tue, 15 Nov 2005 11:55:28 +0000 Subject: [PATCH] - Prepare for including in PHP core --- ext/filter/callback_filter.c | 11 +++++++++++ ext/filter/config.m4 | 5 ++--- ext/filter/filter.c | 17 +++++++---------- ext/filter/filter_private.h | 15 +++++++++++++++ ext/filter/sanitizing_filters.c | 11 +++++++++++ 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c index 446d72e56e..f2cbc35f9b 100644 --- a/ext/filter/callback_filter.c +++ b/ext/filter/callback_filter.c @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* $Id$ */ + #include "php_filter.h" void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL) @@ -34,3 +36,12 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL) call_user_function(EG(function_table), NULL, option_array, value, 1, args TSRMLS_CC); } + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/ext/filter/config.m4 b/ext/filter/config.m4 index 0c3bc46983..7899fe55c8 100644 --- a/ext/filter/config.m4 +++ b/ext/filter/config.m4 @@ -2,10 +2,9 @@ dnl $Id$ dnl config.m4 for input filtering extension PHP_ARG_ENABLE(filter, whether to enable input filter support, -[ --enable-filter Enable input filter support]) +[ --disable-filter Disable input filter support], yes) if test "$PHP_FILTER" != "no"; then - PHP_SUBST(FILTER_SHARED_LIBADD) PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared) - CPPFLAGS="$CPPFLAGS -Wall" + PHP_SUBST(FILTER_SHARED_LIBADD) fi diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 763637bd8c..74076e5c4f 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -99,7 +99,7 @@ zend_module_entry filter_module_entry = { NULL, PHP_RSHUTDOWN(filter), PHP_MINFO(filter), - "0.1", + "0.9.2", STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -128,7 +128,6 @@ static PHP_INI_MH(UpdateDefaultFilter) /* {{{ PHP_INI */ - static PHP_INI_MH(OnUpdateFlags) { if (!new_value) { @@ -139,15 +138,14 @@ static PHP_INI_MH(OnUpdateFlags) return SUCCESS; } - PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("filter.default", "string", PHP_INI_ALL, UpdateDefaultFilter, default_filter, zend_filter_globals, filter_globals) - PHP_INI_ENTRY("filter.default_flags", NULL, PHP_INI_ALL, OnUpdateFlags) + STD_PHP_INI_ENTRY("filter.default", "string", PHP_INI_ALL, UpdateDefaultFilter, default_filter, zend_filter_globals, filter_globals) + PHP_INI_ENTRY("filter.default_flags", NULL, PHP_INI_ALL, OnUpdateFlags) PHP_INI_END() /* }}} */ /* {{{ php_filter_init_globals - */ +*/ static void php_filter_init_globals(zend_filter_globals *filter_globals) { filter_globals->post_array = NULL; @@ -404,7 +402,7 @@ PHP_FUNCTION(input_has_variable) long arg; char *var; int var_len; - zval **tmp; + zval **tmp; zval *array_ptr = NULL; HashTable *hash_ptr; int found = 0; @@ -413,7 +411,7 @@ PHP_FUNCTION(input_has_variable) return; } - switch(arg) { + switch (arg) { case PARSE_GET: FIND_SOURCE(get_array, TRACK_VARS_GET) case PARSE_POST: FIND_SOURCE(post_array, TRACK_VARS_POST) case PARSE_COOKIE: FIND_SOURCE(cookie_array, TRACK_VARS_COOKIE) @@ -445,8 +443,7 @@ PHP_FUNCTION(input_get) char *var, *charset = NULL; int var_len, charset_len; zval *flags = NULL; - - zval **tmp; + zval **tmp; zval *array_ptr = NULL, *array_ptr2 = NULL, *array_ptr3 = NULL; HashTable *hash_ptr; int found = 0; diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index 6e70eae103..26ced7aaed 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -16,6 +16,11 @@ +----------------------------------------------------------------------+ */ +/* $Id$ */ + +#ifndef FILTER_PRIVATE_H +#define FILTER_PRIVATE_H + #define FILTER_FLAG_NONE 0x0000 #define FILTER_FLAG_ALLOW_OCTAL 0x0001 @@ -70,3 +75,13 @@ #define FC_CALLBACK 0x0400 +#endif FILTER_PRIVATE_H + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index d7fae27c27..827d88c984 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* $Id$ */ + #include "php_filter.h" #include "filter_private.h" #include "ext/standard/php_smart_str.h" @@ -313,3 +315,12 @@ void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL) Z_STRLEN_P(value) = len; } /* }}} */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ -- 2.50.1