1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Commit Graph

2121 Commits

Author SHA1 Message Date
Remi Collet ed179c2ef4 workaround typo in system libgd 2.3.0 2020-04-15 09:07:21 +02:00
Máté Kocsis 1f48feebb9 Improve some TypeError and ValueError messages
Closes GH-5377
2020-04-14 14:38:45 +02:00
Máté Kocsis 7b2a8a6dda Lowercase NULL to null in stubs 2020-04-11 14:13:11 +02:00
Máté Kocsis 3709e74b5e Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Nikita Popov 3ea94ed78e Fix typo in GD stub 2020-04-08 12:03:14 +02:00
Máté Kocsis 50765075db Improve some ValueError messages
Closes GH-5340
2020-04-06 10:41:01 +02:00
Máté Kocsis 5322de1ba8 Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Nikita Popov 2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Máté Kocsis b6229fbca2 Display nullability in type error messages for internal functions
Closes GH-5327
2020-03-31 16:55:36 +02:00
Máté Kocsis 01b266aac4 Improve error messages of various extensions
Closes GH-5278
2020-03-23 18:59:04 +01:00
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
George Peter Banyard ac89139773 Fix [-Wtype-limits] in bundled GD lib by using signed integers
As seen in the gdImageRotateBicubicFixed() function the same setup
occurs but it uses signed integers, therefore we use also use
signed integers in gdImageRotateBilinear()

Moreover, these two functions have been removed upstream in
https://github.com/libgd/libgd/commit/bd6d2e101f6f1df106d1cd2e2dc8058a5538109b
therefore we should also mimic upstream and remove them...

Thanks to @cmb69 for pointing it out.
2020-02-06 01:34:09 +01:00
Nikita Popov f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis 99db00b1f2 Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Máté Kocsis d1764ca330 Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis afdaa91170 Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Christoph M. Becker 03bd4333f6 Add imagegetinterpolation()
While `imagesetinterpolation()` is available as of PHP 5.5.0,
there is no according getter function, so users would have to track the
current interpolation method manually.

To remedy this, we introduce `imagegetinterpolation()` as thin wrapper
for `gdImageGetInterpolationMethod()` (which has been introduced with
libgd 2.1.1), and use `im->interpolation_id` as fallback for older
libgd.  Since our bundled libgd does not yet have this function, we add
it.

We also simplify the recently introduced bug79068.phpt, where it is
sufficient to check that the interpolation method has not been changed.
2020-01-14 18:25:27 +01:00
Christoph M. Becker 5836c7063b Avoid superfluous assignments
These values are already set via the initializers.
2020-01-09 00:17:14 +01:00
Christoph M. Becker be0b94c220 Fix hypothetical segfault in gdTransformAffineCopy()
This has been reported to upstream[1], but since ext/gd never calls
`gdTransformAffineCopy()` for a palette image, it is not a bug for PHP.
Therefore we apply the fix to master only.

[1] <https://github.com/libgd/libgd/issues/586>
2020-01-06 13:25:11 +01:00
Christoph M. Becker 5c51a482c9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79068: gdTransformAffineCopy() changes interpolation method
2020-01-06 10:39:00 +01:00
Christoph M. Becker 74b11e3315 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79068: gdTransformAffineCopy() changes interpolation method
2020-01-06 10:38:22 +01:00
Christoph M. Becker 4bec59f175 Fix #79068: gdTransformAffineCopy() changes interpolation method
We port
<https://github.com/libgd/libgd/commit/9088591eae437358ee5b929adf82865e37e3001e>.
2020-01-06 10:36:48 +01:00
Christoph M. Becker bc04d5e9fc Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79067: gdTransformAffineCopy() may use unitialized values
2020-01-06 09:38:19 +01:00
Christoph M. Becker f799f42ec8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79067: gdTransformAffineCopy() may use unitialized values
2020-01-06 09:37:40 +01:00
Christoph M. Becker 2c5860517c Fix #79067: gdTransformAffineCopy() may use unitialized values
We port
<https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
2020-01-06 09:35:13 +01:00
Christoph M. Becker d83f89f076 Remove useless else branch
Passing `NULL` as `gdTransformAffineGetImage()`'s `src_area` is fine,
but in this case there's no need to calculate the `rect`, and since
`pRect` has already been initialized to `NULL`, we can remove the whole
else branch.
2020-01-06 08:54:57 +01:00
Máté Kocsis aadd3aaed9 Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis 9099dbd961 Use RETURN_THROWS() after zend_type_error() 2020-01-01 14:23:21 +01:00
Máté Kocsis 12ce73a5bb Use RETURN_THROWS() after zend_value_error() 2019-12-31 16:58:15 +01:00
Máté Kocsis d9ac1ca8de Use ZEND_THROWS() during ZPP in the GD, gettext, GMP, and hash extensions 2019-12-31 00:21:38 +01:00
Nikita Popov 32fbd2489f Regenerate stubs
Looks like these GD changes got lost along the way...
2019-12-30 12:27:31 +01:00
Máté Kocsis d59bc80782 Fix smaller issues with stubs
GH-5025
2019-12-20 14:31:07 +01:00
Dmitry Stogov 62826e95d2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback. Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().
2019-12-09 15:07:39 +03:00
Dmitry Stogov 92c23e1fd3 Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback.
Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().
2019-12-09 15:05:24 +03:00
Christoph M. Becker 2ede8db1b4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78923: Artifacts when convoluting image with transparency
2019-12-07 12:09:16 +01:00
Christoph M. Becker aba070e630 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78923: Artifacts when convoluting image with transparency
2019-12-07 12:08:30 +01:00
willson-chen b5d2cbe027 Fix #78923: Artifacts when convoluting image with transparency
We have to properly initialize `pxl` before using it.

Fix ported from <https://github.com/libgd/libgd/pull/559>.
2019-12-07 12:06:33 +01:00
Christoph M. Becker b40799efcd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:04:03 +01:00
Christoph M. Becker b78ec58f09 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:02:33 +01:00
Christoph M. Becker b4f501d5a4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:01:05 +01:00
Christoph M. Becker 9b92c1d154 Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
Apparently, this has not been tested for a long time, and might be a
refactoring relict.  Anyhow, we have to pass the context to
`GIFNextPixel` as well.
2019-11-21 09:59:26 +01:00
Máté Kocsis c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Christoph M. Becker 2de79f0855 Make the $num_points parameter of php_imagepolygon optional
That parameter is mostly useless in practise, and likely has been
directly ported from the underlying `gdImagePolygon()` and friends,
which require that parameter since the number of elements of the point
array would otherwise be unknown.  Typical usages of `imagepolygon()`,
`imageopenpolygon()` and `imagefilledpolygon()` pass `count($points)/2`
or hard-code this value as literal.  Since explicitly specifying this
parameter is annoying and error-prone, we offer the possibility to omit
it, in which case the `$points` array must have an even number of
elements, and the number of points is calculated as `count($points)/2`.
2019-11-15 09:41:10 +01:00
Máté Kocsis 27e83d0fb8 Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Christoph M. Becker 7d96dcac2c Fix #55005: imagepolygon num_points requirement
We actually have to check `$num_points` instead of `2*count($points)`,
because the latter may be greater than the former, but not all elements
of `$points` are guaranteed to be used.  This allowed to pass arrays
with excess elements to draw polygons with less than three vertices.

While the current implementation of `gdImagePolygon()` and friends
would allow us to draw monogons and digons, we don't allow that
anymore, because the respective drawing primitives work slightly
different (e.g. drawing lines support anti-aliasing, but drawing
general polygons does not).

To minimize the BC break, we do not fix this longstanding issue for PHP
7, but target PHP 8 only.
2019-11-02 14:05:01 +01:00
Christoph M. Becker 88bab00199 Remove unused code
These are left-overs from image2wbmp(), which has already been removed.
2019-11-02 00:10:46 +01:00
Christoph M. Becker 76179cdf3d Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing skip keyword in tests
  Update NEWS for 7.4.0RC4
  Update NEWS for PHP 7.4.0RC3
2019-10-01 11:19:43 +02:00
Christoph M. Becker 73f29a5c5e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing skip keyword in tests
2019-10-01 11:17:53 +02:00