summaryrefslogtreecommitdiff
path: root/ex_imp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ex_imp.c')
-rw-r--r--ex_imp.c59
1 files changed, 1 insertions, 58 deletions
diff --git a/ex_imp.c b/ex_imp.c
index 3325e43..40d40e0 100644
--- a/ex_imp.c
+++ b/ex_imp.c
@@ -443,6 +443,7 @@ PHP_FUNCTION(suhosin_extract)
443/* }}} */ 443/* }}} */
444 444
445 445
446
446#if PHP_VERSION_ID >= 50300 447#if PHP_VERSION_ID >= 50300
447static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) 448static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
448{ 449{
@@ -478,35 +479,6 @@ static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list ar
478 return 0; 479 return 0;
479 } 480 }
480 481
481 if (Z_STRVAL(new_key)[0] == 'H') {
482 if ((strcmp(Z_STRVAL(new_key), "HTTP_GET_VARS")==0)||
483 (strcmp(Z_STRVAL(new_key), "HTTP_POST_VARS")==0)||
484 (strcmp(Z_STRVAL(new_key), "HTTP_POST_FILES")==0)||
485 (strcmp(Z_STRVAL(new_key), "HTTP_ENV_VARS")==0)||
486 (strcmp(Z_STRVAL(new_key), "HTTP_SERVER_VARS")==0)||
487 (strcmp(Z_STRVAL(new_key), "HTTP_SESSION_VARS")==0)||
488 (strcmp(Z_STRVAL(new_key), "HTTP_COOKIE_VARS")==0)||
489 (strcmp(Z_STRVAL(new_key), "HTTP_RAW_POST_DATA")==0)) {
490 zval_dtor(&new_key);
491 return 0;
492 }
493 } else if (Z_STRVAL(new_key)[0] == '_') {
494 if ((strcmp(Z_STRVAL(new_key), "_COOKIE")==0)||
495 (strcmp(Z_STRVAL(new_key), "_ENV")==0)||
496 (strcmp(Z_STRVAL(new_key), "_FILES")==0)||
497 (strcmp(Z_STRVAL(new_key), "_GET")==0)||
498 (strcmp(Z_STRVAL(new_key), "_POST")==0)||
499 (strcmp(Z_STRVAL(new_key), "_REQUEST")==0)||
500 (strcmp(Z_STRVAL(new_key), "_SESSION")==0)||
501 (strcmp(Z_STRVAL(new_key), "_SERVER")==0)) {
502 zval_dtor(&new_key);
503 return 0;
504 }
505 } else if (strcmp(Z_STRVAL(new_key), "GLOBALS")==0) {
506 zval_dtor(&new_key);
507 return 0;
508 }
509
510 zend_delete_global_variable(Z_STRVAL(new_key), Z_STRLEN(new_key) TSRMLS_CC); 482 zend_delete_global_variable(Z_STRVAL(new_key), Z_STRLEN(new_key) TSRMLS_CC);
511 ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), Z_STRVAL(new_key), Z_STRLEN(new_key) + 1, *var, Z_REFCOUNT_PP(var) + 1, 0); 483 ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), Z_STRVAL(new_key), Z_STRLEN(new_key) + 1, *var, Z_REFCOUNT_PP(var) + 1, 0);
512 484
@@ -554,35 +526,6 @@ static int copy_request_variable(void *pDest, int num_args, va_list args, zend_h
554 return 0; 526 return 0;
555 } 527 }
556 528
557 if (new_key[0] == 'H') {
558 if ((strcmp(new_key, "HTTP_GET_VARS")==0)||
559 (strcmp(new_key, "HTTP_POST_VARS")==0)||
560 (strcmp(new_key, "HTTP_POST_FILES")==0)||
561 (strcmp(new_key, "HTTP_ENV_VARS")==0)||
562 (strcmp(new_key, "HTTP_SERVER_VARS")==0)||
563 (strcmp(new_key, "HTTP_SESSION_VARS")==0)||
564 (strcmp(new_key, "HTTP_COOKIE_VARS")==0)||
565 (strcmp(new_key, "HTTP_RAW_POST_DATA")==0)) {
566 efree(new_key);
567 return 0;
568 }
569 } else if (new_key[0] == '_') {
570 if ((strcmp(new_key, "_COOKIE")==0)||
571 (strcmp(new_key, "_ENV")==0)||
572 (strcmp(new_key, "_FILES")==0)||
573 (strcmp(new_key, "_GET")==0)||
574 (strcmp(new_key, "_POST")==0)||
575 (strcmp(new_key, "_REQUEST")==0)||
576 (strcmp(new_key, "_SESSION")==0)||
577 (strcmp(new_key, "_SERVER")==0)) {
578 efree(new_key);
579 return 0;
580 }
581 } else if (strcmp(new_key, "GLOBALS")==0) {
582 efree(new_key);
583 return 0;
584 }
585
586#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 0) 529#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 0)
587 zend_delete_global_variable(new_key, new_key_len-1 TSRMLS_CC); 530 zend_delete_global_variable(new_key, new_key_len-1 TSRMLS_CC);
588#else 531#else