]> granicus.if.org Git - php/commitdiff
Make all of the ISAPI variables register themselves as Server variables
authorZeev Suraski <zeev@php.net>
Sun, 13 Feb 2000 01:14:45 +0000 (01:14 +0000)
committerZeev Suraski <zeev@php.net>
Sun, 13 Feb 2000 01:14:45 +0000 (01:14 +0000)
NEWS
sapi/isapi/php4isapi.c

diff --git a/NEWS b/NEWS
index 90d3c8c14d7eaad1d9451b6a8587d27b4fd36e48..ae1716a0edaae6bd9b247766011d27be8c580f7a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ PHP 4.0                                                                    NEWS
 - Made foreach() work on objects. (Thies, Zend library)
 - Added domxml extension based on libxml, still little functionality (Uwe)
 - Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev)
-- Updated calendar dynamic library to work with PHP4. (Evan)
+- Updated calendar dynamic library to work with PHP 4. (Evan)
 - Added strncmp() function, courtesy of Walter. (Andrei)
 - Made the output of var_dump() more informative. (Thies)
 - Fixed some OCIBindByName() problems. (Thies)
@@ -209,7 +209,7 @@ November 16 1999, Version 4.0 Beta 3
 - OCI8 connections are now kept open as long as they are referenced (Thies)
 - Cleaned up Directory-Module (Thies)
 - Small fix in Ora_Close (Thies)
-- Ported range() and shuffle() from PHP3 to PHP4 (Andrei)
+- Ported range() and shuffle() from PHP 3 to PHP 4 (Andrei)
 - Fixed header("HTTP/..."); behaviour (Sascha)
 - Improved UNIX build system. Now utilizes libtool (Sascha)
 - Upgrade some more internal functions to use new Zend function API. (Thies, 
index 5277f93e3ec504d02f67aabaa8d689e28e6e3ace..72ba226b3d93d8a858d1e6136d8bc93c5dcd2444 100644 (file)
@@ -299,9 +299,31 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
        char *variable;
        char *strtok_buf = NULL;
        LPEXTENSION_CONTROL_BLOCK lpECB;
+       char **p = isapi_server_variables;
 
        lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
 
+       /* Register the standard ISAPI variables */
+       while (*p) {
+               variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+               if (lpECB->GetServerVariable(lpECB->ConnID, *p, static_variable_buf, &variable_len)
+                       && static_variable_buf[0]) {
+                       php_register_variable(*p, static_variable_buf, track_vars_array ELS_CC PLS_CC);
+               } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+                       variable_buf = (char *) emalloc(variable_len);
+                       if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len)
+                               && variable_buf[0]) {
+                               php_register_variable(*p, variable_buf, track_vars_array ELS_CC PLS_CC);
+                       }
+                       efree(variable_buf);
+               }
+               p++;
+       }
+
+       /* Register the internal bits of ALL_HTTP */
+
+       variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+
        if (lpECB->GetServerVariable(lpECB->ConnID, "ALL_HTTP", static_variable_buf, &variable_len)) {
                variable_buf = static_variable_buf;
        } else {