cvs: php4 /sapi/isapi php4isapi.c
| From: | Ben Mansell | Date: | Fri, 15 Dec 2000 16:18:55 +0000 |
| Subject: | cvs: php4 /sapi/isapi php4isapi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-3180@lists.php.net to get a copy of this message | ||
joosters Fri Dec 15 08:18:55 2000 EDT
Modified files:
/php4/sapi/isapi php4isapi.c
Log:
Fix Zeus' behaviour with URL, SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI
environment variables
PR:
Submitted by:
Reviewed by:
Obtained from:
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.61 php4/sapi/isapi/php4isapi.c:1.62
--- php4/sapi/isapi/php4isapi.c:1.61 Wed Dec 13 09:11:01 2000
+++ php4/sapi/isapi/php4isapi.c Fri Dec 15 08:18:55 2000
@@ -72,27 +72,27 @@
"HTTPS_SERVER_ISSUER",
"HTTPS_SERVER_SUBJECT",
"HTTPS",
- "PATH_INFO",
"PATH_TRANSLATED",
"QUERY_STRING",
"REMOTE_ADDR",
"REMOTE_HOST",
"REMOTE_USER",
"REQUEST_METHOD",
- "REQUEST_URI",
- "SCRIPT_NAME",
"SERVER_NAME",
"SERVER_PORT",
"SERVER_PORT_SECURE",
"SERVER_PROTOCOL",
"SERVER_SOFTWARE",
- "URL",
#ifndef WITH_ZEUS
"APPL_MD_PATH",
"APPL_PHYSICAL_PATH",
"INSTANCE_ID",
"INSTANCE_META_PATH",
"LOGON_USER",
+ "PATH_INFO",
+ "REQUEST_URI",
+ "SCRIPT_NAME",
+ "URL",
#else
"DOCUMENT_ROOT",
#endif
@@ -332,6 +332,34 @@
}
p++;
}
+
+#ifdef WITH_ZEUS
+ /*
+ * Zeus' map module translates the given URL onto the PHP ISAPI libray;
+ * from an internal point of view, SCRIPT_NAME and URL are correct,
+ * but from the end-users point of view, it is not... We need to
+ * reconstruct the SCRIPT_NAME and URL from PATH_INFO, and then
+ * finally clear out PATH_INFO.
+ */
+ variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+ if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf,
&variable_len) && static_variable_buf[0] ) {
+ php_register_variable( "SCRIPT_NAME", static_variable_buf, track_vars_array
ELS_CC PLS_CC );
+ /* append query string to give url... extra byte for '?' */
+ if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE )
{
+ /* append query string only if it is present... */
+ if ( strlen(lpECB->lpszQueryString) ) {
+ static_variable_buf[ variable_len - 1 ] = '?';
+ strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString );
+ }
+ php_register_variable( "URL", static_variable_buf, track_vars_array ELS_CC
PLS_CC );
+ php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array
ELS_CC PLS_CC );
+ }
+ }
+ variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+ if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED",
static_variable_buf, &variable_len) && static_variable_buf[0] ) {
+ php_register_variable( "SCRIPT_FILENAME", static_variable_buf, track_vars_array
ELS_CC PLS_CC );
+ }
+#endif
/* PHP_SELF support */
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;