@@ -143,11 +143,9 @@ typedef struct _php_cgi_globals_struct {
143
143
bool rfc2616_headers ;
144
144
bool nph ;
145
145
bool fix_pathinfo ;
146
- bool force_redirect ;
147
146
bool discard_path ;
148
147
bool fcgi_logging ;
149
148
bool fcgi_logging_request_started ;
150
- char * redirect_status_env ;
151
149
HashTable user_config_cache ;
152
150
char * error_header ;
153
151
char * fpm_config ;
@@ -1423,8 +1421,6 @@ static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_
1423
1421
PHP_INI_BEGIN ()
1424
1422
STD_PHP_INI_BOOLEAN ("cgi.rfc2616_headers" , "0" , PHP_INI_ALL , OnUpdateBool , rfc2616_headers , php_cgi_globals_struct , php_cgi_globals )
1425
1423
STD_PHP_INI_BOOLEAN ("cgi.nph" , "0" , PHP_INI_ALL , OnUpdateBool , nph , php_cgi_globals_struct , php_cgi_globals )
1426
- STD_PHP_INI_BOOLEAN ("cgi.force_redirect" , "1" , PHP_INI_SYSTEM , OnUpdateBool , force_redirect , php_cgi_globals_struct , php_cgi_globals )
1427
- STD_PHP_INI_ENTRY ("cgi.redirect_status_env" , NULL , PHP_INI_SYSTEM , OnUpdateString , redirect_status_env , php_cgi_globals_struct , php_cgi_globals )
1428
1424
STD_PHP_INI_BOOLEAN ("cgi.fix_pathinfo" , "1" , PHP_INI_SYSTEM , OnUpdateBool , fix_pathinfo , php_cgi_globals_struct , php_cgi_globals )
1429
1425
STD_PHP_INI_BOOLEAN ("cgi.discard_path" , "0" , PHP_INI_SYSTEM , OnUpdateBool , discard_path , php_cgi_globals_struct , php_cgi_globals )
1430
1426
STD_PHP_INI_BOOLEAN ("fastcgi.logging" , "1" , PHP_INI_SYSTEM , OnUpdateBool , fcgi_logging , php_cgi_globals_struct , php_cgi_globals )
@@ -1437,8 +1433,6 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals)
1437
1433
{
1438
1434
php_cgi_globals -> rfc2616_headers = 0 ;
1439
1435
php_cgi_globals -> nph = 0 ;
1440
- php_cgi_globals -> force_redirect = 1 ;
1441
- php_cgi_globals -> redirect_status_env = NULL ;
1442
1436
php_cgi_globals -> fix_pathinfo = 1 ;
1443
1437
php_cgi_globals -> discard_path = 0 ;
1444
1438
php_cgi_globals -> fcgi_logging = 1 ;
@@ -1549,7 +1543,7 @@ static zend_module_entry cgi_module_entry = {
1549
1543
int main (int argc , char * argv [])
1550
1544
{
1551
1545
int exit_status = FPM_EXIT_OK ;
1552
- int cgi = 0 , c , use_extended_info = 0 ;
1546
+ int c , use_extended_info = 0 ;
1553
1547
zend_file_handle file_handle ;
1554
1548
1555
1549
/* temporary locals */
@@ -1767,46 +1761,6 @@ int main(int argc, char *argv[])
1767
1761
CG (compiler_options ) |= ZEND_COMPILE_EXTENDED_INFO ;
1768
1762
}
1769
1763
1770
- /* check force_cgi after startup, so we have proper output */
1771
- if (cgi && CGIG (force_redirect )) {
1772
- /* Apache will generate REDIRECT_STATUS,
1773
- * Netscape and redirect.so will generate HTTP_REDIRECT_STATUS.
1774
- * redirect.so and installation instructions available from
1775
- * http://www.koehntopp.de/php.
1776
- * -- kk@netuse.de
1777
- */
1778
- if (!getenv ("REDIRECT_STATUS" ) &&
1779
- !getenv ("HTTP_REDIRECT_STATUS" ) &&
1780
- /* this is to allow a different env var to be configured
1781
- * in case some server does something different than above */
1782
- (!CGIG (redirect_status_env ) || !getenv (CGIG (redirect_status_env )))
1783
- ) {
1784
- zend_try {
1785
- SG (sapi_headers ).http_response_code = 400 ;
1786
- PUTS ("<b>Security Alert!</b> The PHP CGI cannot be accessed directly.\n\n\
1787
- <p>This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\
1788
- means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\
1789
- set, e.g. via an Apache Action directive.</p>\n\
1790
- <p>For more information as to <i>why</i> this behaviour exists, see the <a href=\"http://php.net/security.cgi-bin\">\
1791
- manual page for CGI security</a>.</p>\n\
1792
- <p>For more information about changing this behaviour or re-enabling this webserver,\n\
1793
- consult the installation file that came with this distribution, or visit \n\
1794
- <a href=\"http://php.net/install.windows\">the manual page</a>.</p>\n" );
1795
- } zend_catch {
1796
- } zend_end_try ();
1797
- #if defined(ZTS ) && !PHP_DEBUG
1798
- /* XXX we're crashing here in msvc6 debug builds at
1799
- * php_message_handler_for_zend:839 because
1800
- * SG(request_info).path_translated is an invalid pointer.
1801
- * It still happens even though I set it to null, so something
1802
- * weird is going on.
1803
- */
1804
- tsrm_shutdown ();
1805
- #endif
1806
- return FPM_EXIT_SOFTWARE ;
1807
- }
1808
- }
1809
-
1810
1764
#if ZEND_RC_DEBUG
1811
1765
old_rc_debug = zend_rc_debug ;
1812
1766
zend_rc_debug = 0 ;
0 commit comments