Rasmus Lerdorf wrote:
rasmus Wed May 10 21:19:32 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src NEWS
/php-src/main SAPI.c
/php-src/sapi/apache mod_php5.c
Log:
Add input_filter hook call in getenv()
http://cvs.php.net/viewcvs.cgi/php-src/main/SAPI.c?r1=1.202.2.7&r2=1.202.2.7.2.1&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.202.2.7 php-src/main/SAPI.c:1.202.2.7.2.1
--- php-src/main/SAPI.c:1.202.2.7 Sun Jan 1 12:50:17 2006
+++ php-src/main/SAPI.c Wed May 10 21:19:32 2006
@@ -18,13 +18,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.202.2.7 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: SAPI.c,v 1.202.2.7.2.1 2006/05/10 21:19:32 rasmus Exp $ */
#include <ctype.h>
#include <sys/stat.h>
#include "php.h"
#include "SAPI.h"
+#include "php_variables.h"
#include "php_ini.h"
#include "ext/standard/php_string.h"
#include "ext/standard/pageinfo.h"
@@ -914,11 +915,15 @@
SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC)
{
- if (sapi_module.getenv) {
- return sapi_module.getenv(name, name_len TSRMLS_CC);
+ if (sapi_module.getenv) {
+ char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC);
+ if(tmp) value = estrdup(tmp);
+ else return NULL;
+ sapi_module.input_filter(PARSE_ENV, name, &value,
strlen(value), NULL TSRMLS_CC);
+ return value;
Is this supposed to leak now?
} else {
- return NULL;
- }
+ return NULL;
+ }
}
Regards,
--
Michael
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php