diff options
author | foobar <sniper@php.net> | 2003-02-15 21:41:38 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2003-02-15 21:41:38 +0000 |
commit | 0f41757dfafd8562067cfd9459548ef4a1651fa3 (patch) | |
tree | a13e7c830c172a94bc2071e1f30b04ce72c9d33d | |
parent | cec89cfd763063df90ee071a78ce1fc16493f693 (diff) | |
download | php-git-0f41757dfafd8562067cfd9459548ef4a1651fa3.tar.gz |
- correct version plus the fix.
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 50 |
2 files changed, 17 insertions, 35 deletions
diff --git a/configure.in b/configure.in index 509c2e8fba..86df11a505 100644 --- a/configure.in +++ b/configure.in @@ -43,7 +43,7 @@ AC_CONFIG_HEADER(main/php_config.h) MAJOR_VERSION=4 MINOR_VERSION=3 -RELEASE_VERSION=0 +RELEASE_VERSION=1 EXTRA_VERSION="" VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION" diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 04279cc0f6..e243a65d06 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -441,10 +441,6 @@ static void sapi_cgi_log_message(char *message) static int sapi_cgi_deactivate(TSRMLS_D) { fflush(stdout); - if(SG(request_info).argv0) { - free(SG(request_info).argv0); - SG(request_info).argv0 = NULL; - } return SUCCESS; } @@ -826,7 +822,6 @@ int main(int argc, char *argv[]) int no_headers=0; int orig_optind=ap_php_optind; char *orig_optarg=ap_php_optarg; - char *argv0=NULL; char *script_file=NULL; zend_llist global_vars; int interactive=0; @@ -892,11 +887,6 @@ int main(int argc, char *argv[]) || getenv("GATEWAY_INTERFACE") || getenv("REQUEST_METHOD")) { cgi = 1; - if (argc > 1) { - argv0 = strdup(argv[1]); - } else { - argv0 = NULL; - } } #if PHP_FASTCGI } @@ -1001,7 +991,7 @@ consult the installation file that came with this distribution, or visit \n\ #if ENABLE_PATHINFO_CHECK if (cfg_get_long("cgi.fix_pathinfo", &fix_pathinfo) == FAILURE) { - fix_pathinfo = 1; + fix_pathinfo = 0; } #endif @@ -1176,8 +1166,6 @@ consult the installation file that came with this distribution, or visit \n\ init_request_info(TSRMLS_C); - SG(request_info).argv0 = argv0; - zend_llist_init(&global_vars, sizeof(char *), NULL, 0); CG(interactive) = 0; @@ -1186,11 +1174,7 @@ consult the installation file that came with this distribution, or visit \n\ #if PHP_FASTCGI && !fastcgi #endif - ) { /* never execute the arguments if you are a CGI */ - if (SG(request_info).argv0) { - free(SG(request_info).argv0); - SG(request_info).argv0 = NULL; - } + ) { if (cgi_sapi_module.php_ini_path_override && cgi_sapi_module.php_ini_ignore) { no_headers = 1; @@ -1361,18 +1345,20 @@ consult the installation file that came with this distribution, or visit \n\ } } + if (cgi #if PHP_FASTCGI - if (fastcgi) { - file_handle.type = ZEND_HANDLE_FILENAME; + || fastcgi +#endif + ) { + file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = SG(request_info).path_translated; + file_handle.handle.fp = NULL; } else { -#endif file_handle.filename = "-"; file_handle.type = ZEND_HANDLE_FP; file_handle.handle.fp = stdin; -#if PHP_FASTCGI } -#endif + file_handle.opened_path = NULL; file_handle.free_filename = 0; @@ -1394,17 +1380,13 @@ consult the installation file that came with this distribution, or visit \n\ if (cgi || SG(request_info).path_translated) { retval = php_fopen_primary_script(&file_handle TSRMLS_CC); } - - if (cgi && (retval == FAILURE)) { - if(!argv0 || !(file_handle.handle.fp = VCWD_FOPEN(argv0, "rb"))) { - PUTS("No input file specified.\n"); - php_request_shutdown((void *) 0); - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - file_handle.filename = argv0; - file_handle.opened_path = expand_filepath(argv0, NULL TSRMLS_CC); - } + if (retval == FAILURE || file_handle.handle.fp == NULL) { + SG(sapi_headers).http_response_code = 404; + PUTS("No input file specified.\n"); + php_request_shutdown((void *) 0); + php_module_shutdown(TSRMLS_C); + return FAILURE; + } if (file_handle.handle.fp && (file_handle.handle.fp != stdin)) { /* #!php support */ |