Skip to content

Commit

Permalink
Revert an old bogus patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuraski committed Aug 14, 2001
1 parent 2cf2589 commit 8021e65
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static void init_request_info(TSRMLS_D)
php_destroy_request_info()! */
#if DISCARD_PATH
if (script_filename) {
SG(request_info).path_translated = strdup(script_filename);
SG(request_info).path_translated = estrdup(script_filename);
} else {
SG(request_info).path_translated = NULL;
}
Expand Down Expand Up @@ -538,7 +538,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
break;

case 'f': /* parse file */
script_file = strdup(ap_php_optarg);
script_file = estrdup(ap_php_optarg);
no_headers = 1;
break;

Expand Down Expand Up @@ -687,7 +687,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine

if (!cgi) {
if (!SG(request_info).path_translated && argc > ap_php_optind) {
SG(request_info).path_translated = strdup(argv[ap_php_optind]);
SG(request_info).path_translated = estrdup(argv[ap_php_optind]);
}
} else {
/* If for some reason the CGI interface is not setting the
Expand All @@ -703,7 +703,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
env_path_translated = getenv("PATH_TRANSLATED");
#endif
if(env_path_translated) {
SG(request_info).path_translated = strdup(env_path_translated);
SG(request_info).path_translated = estrdup(env_path_translated);
}
}
if (cgi || SG(request_info).path_translated) {
Expand Down Expand Up @@ -768,12 +768,14 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
#endif
}

php_request_shutdown((void *) 0);

if (SG(request_info).path_translated) {
free(SG(request_info).path_translated);
persist_alloc(SG(request_info).path_translated);
}

php_request_shutdown((void *) 0);

STR_FREE(SG(request_info).path_translated);

if (cgi_sapi_module.php_ini_path_override) {
free(cgi_sapi_module.php_ini_path_override);
}
Expand Down

0 comments on commit 8021e65

Please sign in to comment.