George Peter Banyard
2ecd46f48f
Initialise zend_stat_t to fix MSAN build
2022-05-22 16:06:27 +01:00
Christoph M. Becker
33fc9e5a77
Build ext/zip as shared library by default on Windows
...
This allows users to use PECL/zip, which is well maintained and often
brings new features which are not yet available in ext/zip, as drop-in
replacement for the official Windows php-src builds.
Closes GH-8549.
2022-05-20 14:31:32 +02:00
Remi Collet
6672a5ecfe
bump zip version
2022-05-02 15:18:02 +02:00
Remi Collet
a13b94c5d1
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix test XFAIL, update phar to use spl_autoload_register
bug: Fix type for $index in ZipArchive::replaceFile
2022-05-02 14:19:52 +02:00
Remi Collet
0e9c7c16aa
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
bug: Fix type for $index in ZipArchive::replaceFile
Fix test XFAIL, update phar to use spl_autoload_register
2022-05-02 14:16:01 +02:00
Martin Rehberger
389d11308c
bug: Fix type for $index in ZipArchive::replaceFile
2022-05-02 14:08:19 +02:00
Christoph M. Becker
7f0a1e2f2d
Fix bug40228*.phpt conflict
...
Both tests use the same directory structure; we avoid that by
extracting to separate subdirectories.
Closes GH-7831.
2021-12-26 23:23:56 +01:00
Nikita Popov
902d64390e
Deprecate implicit dynamic properties
...
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().
RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Dmitry Stogov
90b7bde615
Use more compact representation for packed arrays.
...
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values
Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)
TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Remi Collet
105c2e0fcb
bump zip ext version
2021-10-13 11:54:28 +02:00
Remi Collet
8cfd7e2105
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
bump zip ext version
2021-10-13 11:53:25 +02:00
Remi Collet
6d0d5227d8
bump zip ext version
2021-10-13 11:53:02 +02:00
Nikita Popov
dc4cfb1ccb
Don't accept flags in ZipArchive::getStream()
...
Per discussion on e489e2d388
this method should not accept $flags, so un-alias it from
getStreamName().
2021-10-12 09:29:08 +02:00
Nikita Popov
e489e2d388
Add missing $flags param to getStream()
...
This is an alias of getStreamName() but was missing the optional
$flags parameter.
2021-10-11 16:01:57 +02:00
Remi Collet
e9b96ae5da
Add ZipArchive::clearError, getStreamIndex and getStreamName methods
...
public function clearError(): void {}
public function getStreamIndex(int $index, int $flags = 0) {}
public function getStreamName(string $name, int $flags = 0) {}
ZipArchive::getStream is kept for BC
See https://github.com/pierrejoye/php_zip/issues/20
2021-10-11 15:39:35 +02:00
Christoph M. Becker
6e55bd9a4f
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix #77978 : Dirname ending in colon unzips to wrong dir
2021-10-04 12:59:00 +02:00
Christoph M. Becker
9faa11d346
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix #77978 : Dirname ending in colon unzips to wrong dir
2021-10-04 12:58:38 +02:00
Christoph M. Becker
57a32c6a69
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #77978 : Dirname ending in colon unzips to wrong dir
2021-10-04 12:57:01 +02:00
Christoph M. Becker
e0c0de003b
Fix #77978 : Dirname ending in colon unzips to wrong dir
...
When making the relative path, we must not stop on a `:\` sequence in
the middle of the filename. This is only significant on Windows as it
may indicate an absolute filename, but this is already checked at the
beginning of the function.
Note that the bug and this patch affects all systems. However, on
Windows the file is no longer extracted at all, since Windows NTSF does
not allow filenames containing colons.
Closes GH-7528.
2021-10-04 12:55:34 +02:00
Christoph M. Becker
2a3760a2d1
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix #81490 : ZipArchive::extractTo() may leak memory
2021-09-30 15:45:53 +02:00
Christoph M. Becker
80860baeb1
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix #81490 : ZipArchive::extractTo() may leak memory
2021-09-30 15:45:16 +02:00
Christoph M. Becker
5db6e35843
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81490 : ZipArchive::extractTo() may leak memory
2021-09-30 15:42:40 +02:00
Christoph M. Becker
4d44271415
Fix #81490 : ZipArchive::extractTo() may leak memory
...
We always need to free the CWD state.
Closes GH-7536.
2021-09-30 15:41:05 +02:00
Dmitry Stogov
443b196033
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
JIT x86: Fixed register clobbering in code produced for "$x[$y] %= $z".
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-21 10:48:59 +03:00
Stanislav Malyshev
cf7c901970
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-20 21:35:58 -07:00
Stanislav Malyshev
cebff25d27
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-20 21:35:43 -07:00
Stanislav Malyshev
f92bae23ce
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #81420 : ZipArchive::extractTo extracts outside of destination
2021-09-20 21:34:57 -07:00
Christoph M. Becker
df2ceac25a
Fix #81420 : ZipArchive::extractTo extracts outside of destination
...
We need to properly detect and handle absolute paths in a portable way.
2021-09-20 21:29:24 -07:00
Nikita Popov
218fd03532
Fix some more CLEANUP sections
2021-09-03 14:10:40 +02:00
Nikita Popov
7a411564f0
Fix some more CLEAN sections
2021-09-03 11:18:19 +02:00
Remi Collet
d515979b34
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
NEWS + bump zip version
Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:51:37 +02:00
Remi Collet
fde24e4db0
NEWS + bump zip version
2021-09-01 15:51:24 +02:00
Remi Collet
a6ffd8d1e9
Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:49:46 +02:00
Nikita Popov
96f9501b3a
Fix directory clash in zip test
2021-08-13 15:48:47 +02:00
Meletis Flevarakis
5664ae8a9e
Verify exception on ZipArchive::getExternalAttributesName when $name is empty ( #7230 )
...
Co-authored-by: Meletios Flevarakis <m.flevarakis@gmail.com >
2021-07-12 20:42:36 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS ( #7138 )
...
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Remi Collet
3f6a9c9b7b
Remove duplicated test
...
(was previously splitted for <5.3 and >5.3)
2021-06-07 12:11:13 +02:00
Remi Collet
6007bedac2
Merge branch 'PHP-8.0'
...
* PHP-8.0:
zip extension is now 1.19.3
2021-06-07 12:10:10 +02:00
Remi Collet
1671996ed7
zip extension is now 1.19.3
2021-06-07 12:10:01 +02:00
Máté Kocsis
172c29879e
Declare tentative return types for ext/zip ( #7053 )
2021-05-27 10:47:32 +02:00
Nikita Popov
ca8247654c
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix zip build
2021-05-07 22:42:50 +02:00
Nikita Popov
1c2e7b4ea0
Fix zip build
2021-05-07 22:42:31 +02:00
Christoph M. Becker
cc86f70de9
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #80863 : ZipArchive::extractTo() ignores references
2021-05-07 19:22:51 +02:00
Christoph M. Becker
ab3052ab26
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #80863 : ZipArchive::extractTo() ignores references
2021-05-07 19:21:58 +02:00
Christoph M. Becker
57918b1a1b
Fix #80863 : ZipArchive::extractTo() ignores references
...
We need to cater to references, when traversing the files to extract.
While we're at it, we move the `zval_file` declaration into a narrower
scope.
Closes GH-6959.
2021-05-07 19:15:29 +02:00
KsaR
01b3fc03c3
Update http->https in license ( #6945 )
...
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Máté Kocsis
b567a9d173
Use typed properties in ext/zip
...
Closes GH-6881
2021-04-26 13:21:17 +02:00
Christoph M. Becker
1c56a830ce
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #80825 : ZipArchive::isCompressionMethodSupported does not exist
2021-03-03 22:57:51 +01:00
Christoph M. Becker
4f478af16d
Fix #80825 : ZipArchive::isCompressionMethodSupported does not exist
...
`HAVE_METHOD_SUPPORTED` should have been defined after we updated to
libzip 1.7.1 months ago.
2021-03-03 22:56:42 +01:00
Dmitry Stogov
72c3ededed
Change the order of properties used for var_dump(), serialize(), comparison, etc.
...
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00