1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 14:12:38 +02:00
Commit Graph

662 Commits

Author SHA1 Message Date
Remi Collet
2292ef93d5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79424 ext/zip: don't use gl_pathc after call to globfree
2020-03-29 14:23:03 +02:00
Max Rees
04920645f1 Fix #79424 ext/zip: don't use gl_pathc after call to globfree
This breaks on Linux with the musl libc, since it zeroes out gl_pathc during
globfree.
2020-03-29 14:22:31 +02:00
Remi Collet
347d18b48e unneeded after fix 2020-03-20 11:18:52 +01:00
Remi Collet
98687abb1d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  NEWS
  Fix Bug #79296 ZipArchive::open fails on empty file
2020-03-20 11:16:38 +01:00
Remi Collet
8aab43c85d Fix Bug #79296 ZipArchive::open fails on empty file 2020-03-20 11:14:58 +01:00
Remi Collet
5b82fd491a fix test 2020-02-28 10:39:08 +01:00
Remi Collet
7f0d3f1eab Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79315 ZipArchive::addFile doesn't honor start/length parameters
2020-02-28 10:35:39 +01:00
Remi Collet
d31fc591e0 Fix #79315 ZipArchive::addFile doesn't honor start/length parameters 2020-02-28 10:29:50 +01:00
Nikita Popov
58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Remi Collet
7fc06635c4 add test 2020-02-03 10:24:45 +01:00
Remi Collet
3c274613dc Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method 2020-02-03 10:10:17 +01:00
Remi Collet
bdcfdd4402 zip: more constants 2020-01-29 14:25:16 +01:00
Christoph M. Becker
d7052765ed Enable support for LIBZIP_VERSION
This is already supported by non Windows builds for libzip >= 1.3.1,
and since we're using at least libzip 1.4.0 on Windows, we should
support it there as well.
2020-01-28 13:34:07 +01:00
Remi Collet
5215f072af - bump zip extension version to 1.15.6
- add ZipArchive::LIBZIP_VERSION
- skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)
2020-01-27 16:47:28 +01:00
Remi Collet
b9dff1160e Add ZipArchive::CM_LZMA2 constant (since libzip 1.6.0) 2020-01-24 14:06:19 +01:00
Nikita Popov
3e5675d730 Remove unnecessary strncpy in zip
This causes a warning on GCC 9 and is unnecessary to boot: We
only use "cwd" for the open_basedir check, so we can just as well
pass in the original string.
2020-01-03 11:53:03 +01:00
Florian Engelhardt
1eae77221e Added missing call to ZipArchive::close() 2019-10-23 10:44:26 +02:00
Christoph M. Becker
88e0d88897 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:49:46 +02:00
Christoph M. Becker
11654fdfa6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:48:59 +02:00
Christoph M. Becker
fd3118ffb0 Fix #78641: addGlob can modify given remove_path value
`remove_path` points to the given string, so we must not modify it.
Instead we use a duplicate, if we need the modification.

We may want to switch to `zend_string`s in master.
2019-10-08 09:45:05 +02:00
Christoph M. Becker
ce769a94a8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix build for libzip < 0.11.2
2019-09-29 13:38:28 +02:00
Christoph M. Becker
466f91bb3b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix build for libzip < 0.11.2
2019-09-29 13:34:16 +02:00
Christoph M. Becker
f6bfbe9553 Fix build for libzip < 0.11.2
We must not define method entries, if the actual method definitions or
the arginfo structures are not defined.
2019-09-29 13:33:18 +02:00
Remi Collet
a7b00f8787 zip edxtension is now 1.15.5 2019-09-09 14:22:12 +02:00
Remi Collet
766d5ff32f fix type consistency after
8f897f1040
2019-09-09 14:20:57 +02:00
Christoph M. Becker
8f897f1040 Replace deprecated libzip functions
We replace all deprecated libzip functions with their recommended
substitutes, and add proper comment length checks including a test
case.
2019-08-26 14:05:28 +02:00
Christoph M. Becker
eb25176ab3 Remove dead code 2019-08-13 13:29:11 +02:00
George Peter Banyard
6d6d954d0d Cleanup of remaining E_STRICT in tests 2019-07-23 11:27:23 +02:00
Nikita Popov
d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Peter Kokot
15782b27b8 Remove HAVE_LIBZIP
The libzip library is now always used from the system.

Closes GH-4450
2019-07-21 11:32:13 +02:00
Nikita Popov
e2e3ddac7d Canonicalize file-names in zip tests
There were a number of name collisions in there.
2019-07-16 10:25:06 +02:00
Joe Watkins
e2eb1ee1e3 fix flaky zip tests, order is OS dependent 2019-06-12 09:47:47 +02:00
Nikita Popov
3372f2cf2c php_zip_pcre: Match pattern before stating for directories
For two reasons: First, it's generally cheaper to match a regex than
perform a stat (especially on Windows). Second, it will not fail on
concurrent modification of a directory in parts that are not matched
by the pattern, such as the spurious failure in ext/zip/tests/bug72660.phpt.
2019-06-06 11:46:23 +02:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Hugh McMaster
c9830f1c2c ext/zip: Replace $LIBZIP_LIBDIR with $LIBZIP_LIBS
Closes GH-4220.
2019-06-04 15:31:35 +02:00
Hugh McMaster
f349d790b4 ext/zip: Remove un-needed symbol check for zip_open
Closes GH-4189.
2019-06-03 09:20:31 +02:00
Hugh McMaster
310f96fd13 ext/zip: Add PHP_EVAL_LIBLINE to replace PHP_ADD_LIBRARY_WITH_PATH 2019-06-03 09:20:12 +02:00
Nikita Popov
adec208bdb Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 17:44:11 +02:00
Nikita Popov
0cb43ec51c Merge branch 'PHP-7.2' into PHP-7.3 2019-05-27 17:43:13 +02:00
Michael Maroszek
a0c9d0849a Fixed bug #76345 2019-05-27 17:42:20 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Hugh McMaster
a7b5b341b3 Use PKG_CHECK_MODULES to detect the zip library 2019-04-29 14:16:16 +02:00
Hugh McMaster
c9ee822bb6 Always use pkg-config from the host architecture 2019-04-29 14:16:16 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Gabriel Caruso
656db96eb9 Remove HAVE_* for always available extensions 2019-04-14 11:44:12 -03:00
Fabien Villepinte
b6f9ade9f2 Remove unused variables 2019-03-17 23:29:51 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
hassan
173e126a77 Add meaningful error message for ext/zip 2019-03-11 00:15:29 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00