mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Further fixes related to bug #21267.
This commit is contained in:
parent
2e52c112df
commit
c52cdad25a
1 changed files with 6 additions and 3 deletions
|
@ -346,7 +346,11 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
|
|||
if (*location != '/') {
|
||||
if (*(location+1) != '\0') {
|
||||
php_dirname(resource->path, strlen(resource->path));
|
||||
if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') {
|
||||
snprintf(loc_path, sizeof(loc_path) - 1, "%s%s", resource->path, location);
|
||||
} else {
|
||||
snprintf(loc_path, sizeof(loc_path) - 1, "%s/%s", resource->path, location);
|
||||
}
|
||||
} else {
|
||||
snprintf(loc_path, sizeof(loc_path) - 1, "/%s", location);
|
||||
}
|
||||
|
@ -358,8 +362,7 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
|
|||
} else {
|
||||
snprintf(new_path, sizeof(new_path) - 1, "%s://%s%s", resource->scheme, resource->host, loc_path);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
strlcpy(new_path, location, sizeof(new_path));
|
||||
}
|
||||
stream = php_stream_url_wrap_http(NULL, new_path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue