]> granicus.if.org Git - php/commitdiff
Improve performance of the PHP_SELF registration under ISAPI
authorZeev Suraski <zeev@php.net>
Wed, 19 Apr 2000 15:15:33 +0000 (15:15 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 19 Apr 2000 15:15:33 +0000 (15:15 +0000)
sapi/isapi/php4isapi.c

index 378d142200d7e3307e483021f36620e8c644ed85..0b79271bf62ebccbd624b2a988a4be4da6c99d8c 100644 (file)
@@ -322,8 +322,6 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
                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);
-                       if (strcmp(*p, "SCRIPT_NAME") == 0)
-                               php_register_variable("PHP_SELF", 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)
@@ -335,6 +333,12 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
                p++;
        }
 
+       /* PHP_SELF support */
+       if (lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len)
+               && static_variable_buf[0]) {
+               php_register_variable("PHP_SELF", static_variable_buf, track_vars_array ELS_CC PLS_CC);
+       }
+
        /* Register the internal bits of ALL_HTTP */
 
        variable_len = ISAPI_SERVER_VAR_BUF_SIZE;