fopen_wrappers.c DOCUMENT_ROOT .htaccess error

From: Date: Fri, 31 Jul 2009 00:10:17 +0000
Subject: fopen_wrappers.c DOCUMENT_ROOT .htaccess error
Groups: php.internals 
Request: Send a blank email to internals+get-45157@lists.php.net to get a copy of this message
Greetings list, I've modified fopen_wrappers.c to add some custom security checks for our environment. Part of the check requires obtaining the DocumentRoot. The modification begins at line 115 where the DocumentRoot is found: // Document root from Zend (pointer to pointer) zval **document_root = NULL; // Make sure DOCUMENT_ROOT is accessible from the global vars if (!PG(http_globals)[TRACK_VARS_SERVER] || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT"), (void **) &document_root) == FAILURE) { // Unable to find DOCUMENT_ROOT php_error_docref(NULL TSRMLS_CC, E_WARNING, "fopen_wrapper_patch: DOCUMENT_ROOT variable is not set, cannot determine document root."); // Can't check the document root - fail return -1; } The above code has been works fine in PHP 5.2.6. In PHP 5.2.10 it works except when an .htaccess is defined with the following: <--BEGIN SNIP .htaccess--> php_value error_log '/home/st/stu/studio1.com.au/www/logs/php_err.log' <--END SNIP--> The above .htaccess works as expected in PHP 5.2.6 when looking up the DOCUMENT_ROOT. Is there another way to obtain the DOCUMENT_ROOT at this point in the code or has something been introduced into the code since 5.2.6 that is causing a wider issue that needs to be fixed? Your help would be much appreciated. Thanks

« previous php.internals (#45157) next »