summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2016-07-14 17:26:32 +0200
committerChristoph M. Becker <cmb@php.net>2016-07-14 17:31:03 +0200
commit5aaffb79084ba929675a7e8543f91ff324439939 (patch)
tree8b63df34f0fe6de4b3002d5928a51df404df32fd
parente3e400c983d91af84e57c5c8402260ac84ec5459 (diff)
parent5829458215597058c54189b951e0c923deaeaf9b (diff)
downloadphp-git-5aaffb79084ba929675a7e8543f91ff324439939.tar.gz
Merge branch 'PHP-7.0'
-rw-r--r--NEWS3
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/gd/tests/bug72596.phpt12
3 files changed, 19 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 01dfe0c3f8..859f56f72e 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,9 @@ PHP NEWS
. Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
(gooh)
+- GD:
+ . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
+
- Intl:
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
names). (cmb)
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index a1fe114531..a8ed6309df 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1047,6 +1047,7 @@ PHP_MINIT_FUNCTION(gd)
REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_WEBP", 32, CONST_CS | CONST_PERSISTENT);
/* special colours for gd */
REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT);
@@ -2124,6 +2125,9 @@ PHP_FUNCTION(imagetypes)
#if defined(HAVE_GD_XPM)
ret |= 16;
#endif
+#ifdef HAVE_GD_WEBP
+ ret |= 32;
+#endif
if (zend_parse_parameters_none() == FAILURE) {
return;
diff --git a/ext/gd/tests/bug72596.phpt b/ext/gd/tests/bug72596.phpt
new file mode 100644
index 0000000000..2eb7dadb76
--- /dev/null
+++ b/ext/gd/tests/bug72596.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #72596 (imagetypes function won't advertise WEBP support)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+var_dump(function_exists('imagewebp') === (bool) (imagetypes() & IMG_WEBP));
+?>
+--EXPECT--
+bool(true)