sniper Sat Feb 15 16:41:38 2003 EDT
Modified files: (Branch: PHP_4_3_1)
/php4 configure.in
/php4/sapi/cgi cgi_main.c
Log:
- correct version plus the fix.
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.19 php4/configure.in:1.396.2.19.4.1
--- php4/configure.in:1.396.2.19 Thu Dec 26 23:07:18 2002
+++ php4/configure.in Sat Feb 15 16:41:38 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.19 2002/12/27 04:07:18 andrei Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.19.4.1 2003/02/15 21:41:38 sniper Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -43,7 +43,7 @@
MAJOR_VERSION=4
MINOR_VERSION=3
-RELEASE_VERSION=0
+RELEASE_VERSION=1
EXTRA_VERSION=""
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.9 php4/sapi/cgi/cgi_main.c:1.190.2.9.4.1
--- php4/sapi/cgi/cgi_main.c:1.190.2.9 Wed Dec 25 16:14:55 2002
+++ php4/sapi/cgi/cgi_main.c Sat Feb 15 16:41:38 2003
@@ -441,10 +441,6 @@
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 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 @@
|| 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 @@
#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 @@
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 @@
#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 @@
}
}
+ 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 @@
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 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php