Commit graph

2291 commits

Author SHA1 Message Date
Jakub Zelenka
62b2ad4b8a
Merge branch 'PHP-8.3' 2023-11-17 13:42:59 +00:00
Jakub Zelenka
7abe3fe4c6
Merge branch 'PHP-8.2' into PHP-8.3 2023-11-17 13:41:50 +00:00
Jakub Zelenka
6734880ef5
Fix bug #79945: Stream wrappers in imagecreatefrompng causes segfault
Closes GH-12696
2023-11-17 13:26:42 +00:00
Levi Morrison
032b98fb34
Merge branch 'PHP-8.3' 2023-10-02 08:55:49 -06:00
Levi Morrison
5d6c5d6cf6
fix -Wreturn-type and -Wstrict-prototypes in gd configure (#12328) 2023-10-02 08:55:20 -06:00
Ilija Tovilo
692cea5cbc
Use zend_error_noreturn for E_ERROR consistently
To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes GH-12204
2023-09-14 11:44:55 +02:00
Niels Dossche
07330380e0 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix most external GD 2.3.3 compatibility
2023-07-06 21:44:00 +02:00
Niels Dossche
6e0f4865bd Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix most external GD 2.3.3 compatibility
2023-07-06 21:40:20 +02:00
Michael Orlitzky
0aaad46c15 Fix most external GD 2.3.3 compatibility
* ext/gd/tests/bug45799.phpt: tweak to work with external gd.

The expected output from this test contains an extra newline with
gd-2.3.3 from the system (Gentoo). Adding a whitespace wildcard takes
care of it, and the test still passes with the bundled version of gd.

* ext/gd/tests: external gd-2.3.3 compatibility.

Support for the legacy "gd" image format was removed from gd-2.3.3
upstream:
  https://github.com/libgd/libgd/blob/master/CHANGELOG.md#233---2021-09-12

Several tests for the gd extension utilize that format, and naturally
fail when gd-2.3.3 from the system is used. This commit skips those
tests when the version of gd is at least 2.3.3.

* ext/gd/tests/bug73159.phpt: skip with external gd >= 2.3.3

This test uses the imagegd2() function to check that
  https://github.com/libgd/libgd/issues/289

is fixed. When an external gd without support for the "gd" format is
used, no error is thrown, but a nonsense result is printed: this is
normal. The corresponding upstream test is disabled in that situation;
it's not expected to work.

This commit skips the corresponding PHP test under the same
circumstances to fix a test failure with external gd >= 2.3.3.

* ext/gd/tests/bug73155.phpt: skip with external gd >= 2.3.3

This test uses the imagegd2() function to check that
  https://github.com/libgd/libgd/issues/309

is fixed. When an external gd without support for the "gd" format is
used, no error is thrown, but a nonsense result is printed: this is
normal. The corresponding upstream test is disabled in that situation;
it's not expected to work.

This commit skips the corresponding PHP test under the same
circumstances to fix a test failure with external gd >= 2.3.3.

* ext/gd/tests/bug73157.phpt: skip with external gd >= 2.3.3

This test ensures that the third (chunk_size) parameter to imagegd2()
is respected when a fourth parameter is also given. However, when an
external gd without support for the "gd" format is used, the call to
imagegd2() does not really work at all. It doesn't fail, but it
produces an "image" with a nonsense chunk size.

To avoid failures when an external gd >= 2.3.3 is used, we skip the
test entirely in that case.

* ext/gd/tests/bug77973.phpt: accept lowercase "Invalid"

This test fails with an external gd because the test expects "Invalid"
where upstream gd says "invalid". This commit tweaks the expected
output to accept an arbitrary character in the i/I position.

* ext/gd/tests/bug39780_extern.phpt: update for external gd-2.3.3.

Since there are no CI runs with external gd, I can only assume that
this test has fallen out-of-date due to changes in PHP itself. I've
tweaked the expected output (only slightly) so that the test passes
with both gd-2.3.2 and gd-2.3.3.

* ext/gd/tests/bug66356.phpt: update expected output for external gd.

Newer (external) versions of GD start their error messages with
lowercase characters, whereas this test is expecting them in
uppercase. A single-character wildcard now supports both formats.

* ext/gd/tests/imagegd_truecolor.phpt: skip with external gd >= 2.3.3.

This test uses the imagegd() function, but the "gd" format has been
disabled by default in upstream gd-2.3.3. We still get some kind of
image data back from the call to imagegd(), but its "signature",
"truecolor", and "size" no longer match the expected values. This
commit skips the test when an external gd >= 2.3.3 is used.

* ext/gd/tests/createfromwbmp2_extern.phpt: update for external gd-2.3.3.
* ext/gd/tests/libgd00086_extern.phpt: update for external gd-2.3.3.

Since there are no CI runs with external gd, I can only assume that
this test has fallen out-of-date due to changes in PHP itself. I've
tweaked the expected output (only slightly) so that the test passes
with both gd-2.3.2 and gd-2.3.3.

* ext/gd/tests/bug77272.phpt: update expected output for external gd.

Newer (external) versions of GD start their error messages with
lowercase characters, whereas this test is expecting them in
uppercase. A single-character wildcard now supports both formats.

* ext/gd/tests/bug77479.phpt: update for newer external gd.

This test fails with gd-2.3.3 (at least) due to minor capitalization
and whitespace issues. We add some wildcards to account for the
difference.

Closes GH-11257.
Closes GH-11262.
Closes GH-11264.
Closes GH-11280.
2023-07-06 21:39:40 +02:00
David CARLIER
b0d8c10fd9 ext/gd: imagerotate removes ignore_transparent argument.
seems to be a relic of PHP 5 but no longer makes sense in regard of gdImageRotateInterpolated.

Close GH-11426
2023-06-19 12:32:08 +01:00
Javier Eguiluz
732d92c0e5
[skip ci] Fix various typos and grammar issues (#11143) 2023-04-28 11:05:32 +02:00
George Peter Banyard
afd8695a22
Suppress -Wstrict-prototypes in GD extension (#10803)
GD uses variadict functions where the signature depends on the library and types of images.
Until we can use void f(...) that was introduced in C23 suppress this warning.
2023-03-09 07:02:20 +00:00
Niels Dossche
b39ff334a3 Merge branch 'PHP-8.2'
* PHP-8.2:
  Re-add some CTE functions that were removed from being CTE by a mistake
  Fix GH-8065: opcache.consistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context
  Fix GH-8646: Memory leak PHP FPM 8.1
2023-03-07 20:36:41 +01:00
Michael Voříšek
411cd04541 Re-add some CTE functions that were removed from being CTE by a mistake
These functions were accidentally removed from being CTE in GH-7780.
This patch brings them back.

Closes GH-10768.
2023-03-07 20:30:11 +01:00
Ilija Tovilo
5859297f7f
Merge branch 'PHP-8.2'
* PHP-8.2:
  Add Windows GitHub actions build
2023-03-01 23:05:24 +01:00
Ilija Tovilo
603367946b
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add Windows GitHub actions build
2023-03-01 23:05:17 +01:00
Michael Voříšek
916b132ea0
Add Windows GitHub actions build
Closes GH-10664
2023-03-01 23:02:03 +01:00
Máté Kocsis
101178214c
Declare proper parameter default values for imagegd2 (#10569) 2023-02-23 10:54:55 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Bob Weinand
1fbe855971 Honor constant expressions instead of just taking the last constant encountered in stubs
As an example:
should be translated to:
ZVAL_LONG(&attribute_Attribute_class_test_arg0, ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_METHOD);
2023-01-22 21:24:54 +01:00
Niels
58d741c042
Remove unnecessary NULL-checks on ctx (#10256)
ctx can never be zero in these functions because they are dispatched
virtually by looking up their entries in ctx. Furthermore, 2 of these
checks never actually worked because ctx was dereferenced before ctx was
NULL-checked.
2023-01-08 12:09:20 +01:00
Christoph M. Becker
c0789feb31
Merge branch 'PHP-8.2'
* PHP-8.2:
  Update new test to use EXTENSIONS section instead of SKIPIF
2022-10-24 15:03:25 +02:00
Christoph M. Becker
797ee86170
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Update new test to use EXTENSIONS section instead of SKIPIF
2022-10-24 15:02:55 +02:00
Christoph M. Becker
b4fb66463b
Update new test to use EXTENSIONS section instead of SKIPIF 2022-10-24 15:02:05 +02:00
Stanislav Malyshev
f89284541c Merge branch 'PHP-8.2' 2022-10-23 18:49:34 -06:00
Stanislav Malyshev
dedaf40d21 Merge branch 'PHP-8.1' into PHP-8.2 2022-10-23 18:49:30 -06:00
Stanislav Malyshev
33e10cb1e0 Merge branch 'PHP-8.0' into PHP-8.1 2022-10-23 18:49:26 -06:00
Stanislav Malyshev
1d83a407d1 Merge branch 'PHP-7.4' into PHP-8.0 2022-10-23 18:49:21 -06:00
Christoph M. Becker
d50532be91 Fix #81739: OOB read due to insufficient validation in imageloadfont()
If we swap the byte order of the relevant header bytes, we need to make
sure again that the following multiplication does not overflow.
2022-10-23 18:41:48 -06:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
George Peter Banyard
1ad59b32c2 Update INI validator and displayers depending on INI type
Closes GH-9451
2022-09-06 10:33:34 +01:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Christoph M. Becker
b78c087b32
Fix typo (Paletter → Palette)
This also aligns the error message with upstream[1].

[1] <https://github.com/libgd/libgd/blob/gd-2.3.3/src/gd_webp.c#L182>

Closes GH-9414.
2022-08-24 13:40:16 +02:00
Máté Kocsis
056e968c54
Declare ext/gd constants in stubs (#9180) 2022-07-30 15:18:06 +02:00
Michael Voříšek
c756e978c4
Improve tests on 32bit
The watch_*.phpt test apparently no longer fail on 32bit, so we remove
the XFAIL conditions.  bug77269.phpt is practically identical to
bug77272.phpt, and there seems no particular reason to have an
additional test for libgd ≤ 2.2.5.

Closes GH-8448.
2022-06-29 14:04:40 +02:00
Christoph M. Becker
365537fd6d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:28 +02:00
Christoph M. Becker
bc8e52f651
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:09 +02:00
Christoph M. Becker
9405f43ba9
Fix GH-8848: imagecopyresized() error refers to the wrong argument
Closes GH-8849.
2022-06-23 15:20:49 +02:00
Christoph M. Becker
98a4ab2266
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix imagecreatefromavif() memory leak
2022-06-17 17:31:48 +02:00
Christoph M. Becker
036bed01ce
Fix imagecreatefromavif() memory leak
This has been reported as https://github.com/libgd/libgd/issues/831.
We port the respective fix to our bundled libgd.

Closes GH-8812.
2022-06-17 17:30:57 +02:00
George Peter Banyard
8649cb8a96
Improve and fix stub return types (#8368) 2022-04-14 18:38:00 +01:00
Christoph M. Becker
0052af2a67
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed libpng warning when loading interlaced images
2022-02-08 10:48:58 +01:00
Christoph M. Becker
4a630e67e9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed libpng warning when loading interlaced images
2022-02-08 10:48:21 +01:00
Brett
1d48da6da5
Fixed libpng warning when loading interlaced images
We enable interlace transform when reading png.

Closes GH-8002.
2022-02-08 10:46:50 +01:00
Remi Collet
baeba4b0d7
Merge branch 'PHP-8.1'
* PHP-8.1:
  add missing conditions
  fix [-Wstrict-prototypes] build warnings in ext/gd
2021-11-25 13:20:37 +01:00
Remi Collet
54f1f8cf2a
add missing conditions 2021-11-25 13:20:27 +01:00
Remi Collet
1241ec8c3f
fix [-Wstrict-prototypes] build warnings in ext/gd 2021-11-25 13:17:15 +01:00
Remi Collet
f566cba0bb
fix [-Wstrict-prototypes] build warnings in ext/gd 2021-11-25 13:17:07 +01:00
Remi Collet
7c0f2b4dc0
Merge branch 'PHP-8.1'
* PHP-8.1:
  add missing cond.
  Enable encoding detection for Polish text
2021-11-25 10:16:34 +01:00