mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: fix perm again... cleanup uneeded cast fix bad pointer cast in ext/phar, fix segfault and failed tests (bigendian) Conflicts: ext/phar/func_interceptors.c ext/phar/phar_object.c sapi/apache2handler/sapi_apache2.c
This commit is contained in:
commit
a85eb75cba
3 changed files with 10 additions and 9 deletions
|
@ -339,7 +339,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
|
|||
}
|
||||
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
|
||||
char *arch, *entry, *fname;
|
||||
size_t arch_len, entry_len, fname_len;
|
||||
int arch_len, entry_len, fname_len;
|
||||
php_stream_context *context = NULL;
|
||||
char *name;
|
||||
phar_archive_data *phar;
|
||||
|
@ -349,7 +349,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
|
|||
goto skip_phar;
|
||||
}
|
||||
fname_len = strlen(fname);
|
||||
if (FAILURE == phar_split_fname(fname, fname_len, &arch, (int *)&arch_len, &entry, (int *)&entry_len, 2, 0)) {
|
||||
if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
|
||||
goto skip_phar;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
|
|||
name = entry;
|
||||
}
|
||||
} else {
|
||||
entry = phar_fix_filepath(estrndup(entry, entry_len), (int *)&entry_len, 1);
|
||||
entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
|
||||
if (entry[0] == '/') {
|
||||
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
|
||||
/* this file is not in the phar, use the original path */
|
||||
|
|
|
@ -546,7 +546,8 @@ PHP_METHOD(Phar, webPhar)
|
|||
{
|
||||
zval *mimeoverride = NULL, *rewrite = NULL;
|
||||
char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL;
|
||||
size_t alias_len = 0, f404_len = 0, free_pathinfo = 0, ru_len = 0;
|
||||
size_t alias_len = 0, f404_len = 0, free_pathinfo = 0;
|
||||
int ru_len = 0;
|
||||
char *fname, *path_info, *mime_type = NULL, *entry, *pt;
|
||||
const char *basename;
|
||||
size_t fname_len, index_php_len = 0;
|
||||
|
@ -729,7 +730,7 @@ PHP_METHOD(Phar, webPhar)
|
|||
}
|
||||
|
||||
if (entry_len) {
|
||||
phar_postprocess_ru_web(fname, fname_len, &entry, (int *)&entry_len, &ru, (int *)&ru_len);
|
||||
phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len);
|
||||
}
|
||||
|
||||
if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
|
||||
|
@ -1999,7 +2000,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
|
|||
zend_class_entry *ce;
|
||||
char *error;
|
||||
const char *pcr_error;
|
||||
size_t ext_len = ext ? strlen(ext) : 0;
|
||||
int ext_len = ext ? strlen(ext) : 0;
|
||||
int oldname_len;
|
||||
phar_archive_data *pphar = NULL;
|
||||
php_stream_statbuf ssb;
|
||||
|
@ -2050,7 +2051,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
|
|||
ext = "phar";
|
||||
}
|
||||
}
|
||||
} else if (phar_path_check(&ext, (int *)&ext_len, &pcr_error) > pcr_is_ok) {
|
||||
} else if (phar_path_check(&ext, &ext_len, &pcr_error) > pcr_is_ok) {
|
||||
|
||||
if (phar->is_data) {
|
||||
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
|
||||
|
|
|
@ -279,12 +279,12 @@ php_apache_sapi_register_variables(zval *track_vars_array)
|
|||
if (!val) {
|
||||
val = "";
|
||||
}
|
||||
if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (size_t *)&new_val_len)) {
|
||||
if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len)) {
|
||||
php_register_variable_safe(key, val, new_val_len, track_vars_array);
|
||||
}
|
||||
APR_ARRAY_FOREACH_CLOSE()
|
||||
|
||||
if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (size_t *)&new_val_len)) {
|
||||
if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len)) {
|
||||
php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue