Diff for /embedaddon/php/sapi/apache_hooks/php_apache.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 23:48:06 version 1.1.1.3, 2013/07/22 01:32:13
Line 2 Line 2
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | PHP Version 5                                                        |     | PHP Version 5                                                        |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
   | Copyright (c) 1997-2012 The PHP Group                                |   | Copyright (c) 1997-2013 The PHP Group                                |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | This source file is subject to version 3.01 of the PHP license,      |     | This source file is subject to version 3.01 of the PHP license,      |
    | that is bundled with this package in the file LICENSE, and is        |     | that is bundled with this package in the file LICENSE, and is        |
Line 44  extern module **ap_loaded_modules; Line 44  extern module **ap_loaded_modules;
 static int le_apachereq;  static int le_apachereq;
 static zend_class_entry *apacherequest_class_entry;  static zend_class_entry *apacherequest_class_entry;
   
static void apache_table_to_zval(table *, int safe_mode, zval *return_value);static void apache_table_to_zval(table *, zval *return_value);
   
 PHP_FUNCTION(virtual);  PHP_FUNCTION(virtual);
 PHP_FUNCTION(apache_request_headers);  PHP_FUNCTION(apache_request_headers);
Line 567  PHP_FUNCTION(apache_request_headers_in) Line 567  PHP_FUNCTION(apache_request_headers_in)
                   
         APREQ_GET_REQUEST(id, r);          APREQ_GET_REQUEST(id, r);
   
        apache_table_to_zval(r->headers_in, 0, return_value);        apache_table_to_zval(r->headers_in, return_value);
 }  }
 /* }}} */  /* }}} */
   
Line 664  PHP_FUNCTION(apache_request_headers_out) Line 664  PHP_FUNCTION(apache_request_headers_out)
                 add_header_to_table(r->headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU);                  add_header_to_table(r->headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         }          }
   
        apache_table_to_zval(r->headers_out, 0, return_value);        apache_table_to_zval(r->headers_out, return_value);
 }  }
 /* }}} */  /* }}} */
   
Line 683  PHP_FUNCTION(apache_request_err_headers_out) Line 683  PHP_FUNCTION(apache_request_err_headers_out)
                 add_header_to_table(r->err_headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU);                  add_header_to_table(r->err_headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         }          }
   
        apache_table_to_zval(r->err_headers_out, 0, return_value);        apache_table_to_zval(r->err_headers_out, return_value);
 }  }
 /* }}} */  /* }}} */
   
Line 1683  PHP_MINFO_FUNCTION(apache) Line 1683  PHP_MINFO_FUNCTION(apache)
                 env_arr = table_elts(r->headers_in);                  env_arr = table_elts(r->headers_in);
                 env = (table_entry *)env_arr->elts;                  env = (table_entry *)env_arr->elts;
                 for (i = 0; i < env_arr->nelts; ++i) {                  for (i = 0; i < env_arr->nelts; ++i) {
                        if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) {                        if (env[i].key) {
                                 php_info_print_table_row(2, env[i].key, env[i].val);                                  php_info_print_table_row(2, env[i].key, env[i].val);
                         }                          }
                 }                  }
Line 1734  PHP_FUNCTION(virtual) Line 1734  PHP_FUNCTION(virtual)
                 RETURN_FALSE;                  RETURN_FALSE;
         }          }
   
        php_end_ob_buffers(1 TSRMLS_CC);        php_output_end_all(TSRMLS_C);
         php_header(TSRMLS_C);          php_header(TSRMLS_C);
   
         if (run_sub_req(rr)) {          if (run_sub_req(rr)) {
Line 1751  PHP_FUNCTION(virtual) Line 1751  PHP_FUNCTION(virtual)
 /* }}} */  /* }}} */
   
   
/* {{{ apache_table_to_zval(table *, int safe_mode, zval *return_value)/* {{{ apache_table_to_zval(table *, zval *return_value)
    Fetch all HTTP request headers */     Fetch all HTTP request headers */
static void apache_table_to_zval(table *t, int safe_mode, zval *return_value)static void apache_table_to_zval(table *t, zval *return_value)
 {  {
     array_header *env_arr;      array_header *env_arr;
     table_entry *tenv;      table_entry *tenv;
Line 1763  static void apache_table_to_zval(table *t, int safe_mo Line 1763  static void apache_table_to_zval(table *t, int safe_mo
     env_arr = table_elts(t);      env_arr = table_elts(t);
     tenv = (table_entry *)env_arr->elts;      tenv = (table_entry *)env_arr->elts;
     for (i = 0; i < env_arr->nelts; ++i) {      for (i = 0; i < env_arr->nelts; ++i) {
                if (!tenv[i].key ||                if (!tenv[i].key) {
                        (safe_mode && !strncasecmp(tenv[i].key, "authorization", 13))) { 
                         continue;                          continue;
                 }                  }
                 if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {                  if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
Line 1789  PHP_FUNCTION(apache_request_headers) Line 1788  PHP_FUNCTION(apache_request_headers)
                 return;                  return;
         }          }
   
        apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, PG(safe_mode), return_value);        apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, return_value);
 }  }
 /* }}} */  /* }}} */
   
Line 1801  PHP_FUNCTION(apache_response_headers) Line 1800  PHP_FUNCTION(apache_response_headers)
                 return;                  return;
         }          }
   
        apache_table_to_zval(((request_rec *) SG(server_context))->headers_out, 0, return_value);        apache_table_to_zval(((request_rec *) SG(server_context))->headers_out, return_value);
 }  }
 /* }}} */  /* }}} */
   
Line 1906  PHP_FUNCTION(apache_lookup_uri) Line 1905  PHP_FUNCTION(apache_lookup_uri)
   
   
 #if 0  #if 0
   /*
 This function is most likely a bad idea.  Just playing with it for now.  This function is most likely a bad idea.  Just playing with it for now.
   */
   
 PHP_FUNCTION(apache_exec_uri)  PHP_FUNCTION(apache_exec_uri)
 {  {
         zval **filename;          zval **filename;
         request_rec *rr=NULL;          request_rec *rr=NULL;
         TSRMLS_FETCH();  
   
         if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {          if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
                 WRONG_PARAM_COUNT;                  WRONG_PARAM_COUNT;

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>