Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/phar/phar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,11 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname

/* set up our manifest */
zend_hash_init(&mydata->manifest, manifest_count,
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, manifest_count * 2,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
mydata->fname = pestrndup(fname, fname_len, mydata->is_persistent);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
Expand Down Expand Up @@ -1451,7 +1451,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(c
zend_hash_init(&mydata->mounted_dirs, sizeof(char *),
zend_get_hash_value, NULL, 0);
zend_hash_init(&mydata->virtual_dirs, sizeof(char *),
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
mydata->fname_len = fname_len;
snprintf(mydata->version, sizeof(mydata->version), "%s", PHP_PHAR_API_VERSION);
mydata->is_temporary_alias = alias ? 0 : 1;
Expand Down
10 changes: 2 additions & 8 deletions ext/phar/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
php_stream_statbuf *ssb, php_stream_context *context) /* {{{ */
{
php_url *resource = NULL;
char *internal_file, *error;
char *internal_file;
phar_archive_data *phar;
phar_entry_info *entry;
size_t internal_file_len;
Expand All @@ -582,16 +582,10 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f

internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */
/* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */
if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, &error)) {
if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, NULL)) {
php_url_free(resource);
if (error) {
efree(error);
}
return FAILURE;
}
if (error) {
efree(error);
}
if (*internal_file == '\0') {
/* root directory requested */
phar_dostat(phar, NULL, ssb, true);
Expand Down
6 changes: 3 additions & 3 deletions ext/phar/tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
myphar->is_persistent = PHAR_G(persist);
/* estimate number of entries, can't be certain with tar files */
zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12),
zend_get_hash_value, destroy_phar_manifest_entry, (bool)myphar->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, myphar->is_persistent);
zend_hash_init(&myphar->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
zend_get_hash_value, NULL, myphar->is_persistent);
zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11),
zend_get_hash_value, NULL, (bool)myphar->is_persistent);
zend_get_hash_value, NULL, myphar->is_persistent);
myphar->is_tar = 1;
/* remember whether this entire phar was compressed with gz/bzip2 */
myphar->flags = compression;
Expand Down
6 changes: 3 additions & 3 deletions ext/phar/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch
php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET);
/* read in central directory */
zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count),
zend_get_hash_value, destroy_phar_manifest_entry, (bool)mydata->is_persistent);
zend_get_hash_value, destroy_phar_manifest_entry, mydata->is_persistent);
zend_hash_init(&mydata->mounted_dirs, 5,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2,
zend_get_hash_value, NULL, (bool)mydata->is_persistent);
zend_get_hash_value, NULL, mydata->is_persistent);
entry.phar = mydata;
entry.is_zip = 1;
entry.fp_type = PHAR_FP;
Expand Down
31 changes: 23 additions & 8 deletions ext/tidy/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,34 @@ if test "$PHP_TIDY" != "no"; then
[],
[-L$TIDY_LIBDIR])

dnl The tidyOptGetCategory function (added in libtidy 5.4.0) if only useable
dnl if TidyInternalCategory (added in libtidy 5.6.0) is also present.
PHP_CHECK_LIBRARY([$TIDY_LIB_NAME], [tidyInternalCategory],
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
[Define to 1 if Tidy library has the 'tidyOptGetCategory' function.])],
[],
[-L$TIDY_LIBDIR])

PHP_ADD_LIBRARY_WITH_PATH([$TIDY_LIB_NAME],
[$TIDY_LIBDIR],
[TIDY_SHARED_LIBADD])
PHP_ADD_INCLUDE([$TIDY_INCDIR])

old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$TIDY_INCDIR

dnl The tidyOptGetCategory function (added in tidy-html5 5.4.0) is only
dnl useable if TidyInternalCategory (added in tidy-html5 5.6.0) is also
dnl present.
AC_CACHE_CHECK([for tidyOptGetCategory], [php_ac_cv_have_tidyoptgetcategory],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <tidy.h>],[
TidyDoc doc = tidyCreate();
TidyOption badopt = tidyGetOptionByName(doc, "<bad>");
Bool v = (tidyOptGetCategory(badopt) == TidyInternalCategory);
(void)v;
tidyRelease(doc);
])],
[php_ac_cv_have_tidyoptgetcategory=yes],
[php_ac_cv_have_tidyoptgetcategory=no])
])
AS_VAR_IF([php_ac_cv_have_tidyoptgetcategory], [yes],
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
[Define to 1 if tidyOptGetCategory is available.])])

CPPFLAGS=$old_CPPFLAGS

dnl Add -Wno-ignored-qualifiers as this is an issue upstream. Fixed in
dnl tidy-html5 5.7.20: https://github.com/htacg/tidy-html5/issues/866
PHP_NEW_EXTENSION([tidy],
Expand Down