summaryrefslogtreecommitdiff
path: root/ex_imp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ex_imp.c')
-rw-r--r--ex_imp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ex_imp.c b/ex_imp.c
index 40d40e0..e1b93fc 100644
--- a/ex_imp.c
+++ b/ex_imp.c
@@ -444,6 +444,13 @@ PHP_FUNCTION(suhosin_extract)
444 444
445 445
446 446
447#if PHP_VERSION_ID < 50400
448/* import_request_variables() has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. */
449#define SUHOSIN_HAVE_IRV 1
450#endif
451
452#ifdef SUHOSIN_HAVE_IRV
453
447#if PHP_VERSION_ID >= 50300 454#if PHP_VERSION_ID >= 50300
448static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) 455static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
449{ 456{
@@ -657,22 +664,28 @@ PHP_FUNCTION(suhosin_import_request_variables)
657} 664}
658/* }}} */ 665/* }}} */
659 666
667#endif /* SUHOSIN_HAVE_IRV */
668
660ZEND_BEGIN_ARG_INFO_EX(suhosin_arginfo_extract, 0, 0, 1) 669ZEND_BEGIN_ARG_INFO_EX(suhosin_arginfo_extract, 0, 0, 1)
661 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */ 670 ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
662 ZEND_ARG_INFO(0, extract_type) 671 ZEND_ARG_INFO(0, extract_type)
663 ZEND_ARG_INFO(0, prefix) 672 ZEND_ARG_INFO(0, prefix)
664ZEND_END_ARG_INFO() 673ZEND_END_ARG_INFO()
665 674
675#ifdef SUHOSIN_HAVE_IRV
666ZEND_BEGIN_ARG_INFO_EX(suhosin_arginfo_import_request_variables, 0, 0, 1) 676ZEND_BEGIN_ARG_INFO_EX(suhosin_arginfo_import_request_variables, 0, 0, 1)
667 ZEND_ARG_INFO(0, types) 677 ZEND_ARG_INFO(0, types)
668 ZEND_ARG_INFO(0, prefix) 678 ZEND_ARG_INFO(0, prefix)
669ZEND_END_ARG_INFO() 679ZEND_END_ARG_INFO()
680#endif
670 681
671/* {{{ suhosin_ex_imp_functions[] 682/* {{{ suhosin_ex_imp_functions[]
672 */ 683 */
673zend_function_entry suhosin_ex_imp_functions[] = { 684zend_function_entry suhosin_ex_imp_functions[] = {
674 PHP_NAMED_FE(extract, PHP_FN(suhosin_extract), suhosin_arginfo_extract) 685 PHP_NAMED_FE(extract, PHP_FN(suhosin_extract), suhosin_arginfo_extract)
686#ifdef SUHOSIN_HAVE_IRV
675 PHP_NAMED_FE(import_request_variables, PHP_FN(suhosin_import_request_variables), suhosin_arginfo_import_request_variables) 687 PHP_NAMED_FE(import_request_variables, PHP_FN(suhosin_import_request_variables), suhosin_arginfo_import_request_variables)
688#endif
676 {NULL, NULL, NULL} 689 {NULL, NULL, NULL}
677}; 690};
678/* }}} */ 691/* }}} */
@@ -683,7 +696,9 @@ void suhosin_hook_ex_imp()
683 696
684 /* replace the extract and import_request_variables functions */ 697 /* replace the extract and import_request_variables functions */
685 zend_hash_del(CG(function_table), "extract", sizeof("extract")); 698 zend_hash_del(CG(function_table), "extract", sizeof("extract"));
699#ifdef SUHOSIN_HAVE_IRV
686 zend_hash_del(CG(function_table), "import_request_variables", sizeof("import_request_variables")); 700 zend_hash_del(CG(function_table), "import_request_variables", sizeof("import_request_variables"));
701#endif
687#ifndef ZEND_ENGINE_2 702#ifndef ZEND_ENGINE_2
688 zend_register_functions(suhosin_ex_imp_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); 703 zend_register_functions(suhosin_ex_imp_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
689#else 704#else