From 708811184d2c7534495f293b4c21203c717ea8aa Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 19 Apr 2000 15:15:33 +0000 Subject: [PATCH] Improve performance of the PHP_SELF registration under ISAPI --- sapi/isapi/php4isapi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index 378d142200..0b79271bf6 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -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; -- 2.40.0