rasmus          Mon Mar 17 18:27:08 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/sapi/apache        mod_php5.c 
  Log:
  Revert
  
  Never mind, it looks like ext/filter does an estrdup on everything it 
  gets which doesn't seem very efficient to me as most things it gets 
  passed will already be emalloc'ed.  My custom version of the filter
  extension doesn't do this which led to the confusion.
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/mod_php5.c?r1=1.19.2.7.2.13.2.3&r2=1.19.2.7.2.13.2.4&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.19.2.7.2.13.2.3 
php-src/sapi/apache/mod_php5.c:1.19.2.7.2.13.2.4
--- php-src/sapi/apache/mod_php5.c:1.19.2.7.2.13.2.3    Mon Mar 17 18:03:31 2008
+++ php-src/sapi/apache/mod_php5.c      Mon Mar 17 18:27:08 2008
@@ -17,7 +17,7 @@
    | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>                      |
    +----------------------------------------------------------------------+
  */
-/* $Id: mod_php5.c,v 1.19.2.7.2.13.2.3 2008/03/17 18:03:31 rasmus Exp $ */
+/* $Id: mod_php5.c,v 1.19.2.7.2.13.2.4 2008/03/17 18:27:08 rasmus Exp $ */
 
 #include "php_apache_http.h"
 #include "http_conf_globals.h"
@@ -243,12 +243,14 @@
        table_entry *elts = (table_entry *) arr->elts;
        zval **path_translated;
        HashTable *symbol_table;
-       int val_len, new_val_len;
-       char *val;
+       int new_val_len;
 
        for (i = 0; i < arr->nelts; i++) {
+               char *val;
+               int val_len;
+
                if (elts[i].val) {
-                       val = estrdup(elts[i].val);
+                       val = elts[i].val;
                } else {
                        val = "";
                }
@@ -273,9 +275,8 @@
                php_register_variable("PATH_TRANSLATED", 
Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC);
        }
 
-       val = estrdup(((request_rec *)SG(server_context))->uri);
-       if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", val, 
strlen(val), &new_val_len TSRMLS_CC)) {
-               php_register_variable_safe("PHP_SELF", val, new_val_len, 
track_vars_array TSRMLS_CC);
+       if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec 
*) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), 
&new_val_len TSRMLS_CC)) {
+               php_register_variable("PHP_SELF", ((request_rec *) 
SG(server_context))->uri, track_vars_array TSRMLS_CC);
        }
 }
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to