mirror of
https://github.com/php/php-src.git
synced 2025-01-26 21:54:16 +08:00
- No revert the automatically inserted /*..*/ where wrong
This commit is contained in:
parent
570e38fde8
commit
77232928a5
@ -526,7 +526,7 @@ PHP_PHAR_API php_stream * php_stream_phar_url_wrapper(php_stream_wrapper *wrappe
|
||||
#endif
|
||||
|
||||
resource = php_url_parse(path);
|
||||
/* we must have at the very least phar:/*alias.phar/internalfile.php */*/
|
||||
/* we must have at the very least phar://alias.phar/internalfile.php */
|
||||
if (!resource || !resource->scheme || !resource->host || !resource->path) {
|
||||
if (resource) {
|
||||
php_url_free(resource);
|
||||
@ -933,7 +933,7 @@ PHP_PHAR_API int phar_stream_stat(php_stream_wrapper *wrapper, char *url, int fl
|
||||
phar_manifest_entry *file_data;
|
||||
|
||||
resource = php_url_parse(url);
|
||||
/* we must have at the very least phar:/*alias.phar/internalfile.php */*/
|
||||
/* we must have at the very least phar://alias.phar/internalfile.php */
|
||||
if (!resource || !resource->scheme || !resource->host || !resource->path) {
|
||||
php_url_free(resource);
|
||||
php_stream_wrapper_log_error(wrapper, flags TSRMLS_CC, "phar error: invalid url \"%s\"", url);
|
||||
@ -948,7 +948,7 @@ PHP_PHAR_API int phar_stream_stat(php_stream_wrapper *wrapper, char *url, int fl
|
||||
}
|
||||
|
||||
internal_file = resource->path + 1; /* strip leading "/" */
|
||||
/* find the phar in our trusty global hash indexed by alias (host of phar:/*blah.phar/file.whatever) */*/
|
||||
/* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */
|
||||
if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_data), resource->host, strlen(resource->host), (void **) &data)) {
|
||||
if (*internal_file == '\0') {
|
||||
/* root directory requested */
|
||||
@ -1116,15 +1116,15 @@ PHP_PHAR_API php_stream *phar_opendir(php_stream_wrapper *wrapper, char *filenam
|
||||
phar_manifest_entry *file_data;
|
||||
|
||||
resource = php_url_parse(filename);
|
||||
/* we must have at the very least phar:/*alias.phar/ */*/
|
||||
/* we must have at the very least phar://alias.phar/ */
|
||||
if (!resource || !resource->scheme || !resource->host || !resource->path) {
|
||||
if (resource->host && !resource->path) {
|
||||
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar:/*%s/ for root directory", filename, resource->host);*/
|
||||
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory", filename, resource->host);
|
||||
php_url_free(resource);
|
||||
return NULL;
|
||||
}
|
||||
php_url_free(resource);
|
||||
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\", must have at least phar:/*%s/", filename, filename);*/
|
||||
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\", must have at least phar://%s/", filename, filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user