Skip to content

Commit 1f261d7

Browse files
committed
Merge branch 'master' into sccp
* master: Bump OCI8 version for recent patch WS Fix test title Ensure that the stream position is kept between reads Turn off EXIF_DEBUG so Travis don't complain at me Don't add a new line to undefined tags in EXIF_DEBUG mode Fix compile error with EXIF_DEBUG update NEWS disable --with-pcre-valgrind on travis fix default args for --with-pcre-valgrind Enable valgrind support for PCRE by default in debug builds add oniguruma.patch to ease future upgrades SIZEOF_SIZE_T doesn't exist on AIX and POWER8 (ppc64le), keep using SIZEOF_LONG
2 parents a32a3fb + b280ba8 commit 1f261d7

File tree

11 files changed

+155
-18
lines changed

11 files changed

+155
-18
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,8 @@ win32/wsyslog.h
229229
**/tests/**/*.db
230230
**/tests/**/*.txt
231231
**/tests/**/*.tmp
232+
233+
# special cases to invert previous ignore rules
234+
!ext/fileinfo/libmagic.patch
235+
!ext/mbstring/oniguruma.patch
236+

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PHP NEWS
1111
php_parse_date()). (Derick)
1212
. Fixed bug #49649 (unserialize() doesn't handle changes in property
1313
visibility). (pmmaga)
14+
. Fixed #74866 (extension_dir = "./ext" now use current directory for base).
15+
(Francois Laupretre)
1416

1517
- Date:
1618
. Fixed bug #74852 (property_exists returns true on unknown DateInterval

ext/exif/exif.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
15521552
return value_ptr ? value_ptr : "<no data>";
15531553
}
15541554
if (format == TAG_FMT_UNDEFINED) {
1555-
return "<undefined>\n";
1555+
return "<undefined>";
15561556
}
15571557
if (format == TAG_FMT_IFD) {
15581558
return "";
@@ -3723,7 +3723,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo)
37233723
unsigned int ll, lh;
37243724
uchar *Data;
37253725
size_t fpos, size, got, itemlen;
3726-
jpeg_sof_info sof_info;
3726+
jpeg_sof_info sof_info;
37273727

37283728
for(section=0;;section++) {
37293729
#ifdef EXIF_DEBUG
@@ -4305,9 +4305,9 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
43054305
}
43064306
/* }}} */
43074307

4308-
/* {{{ exif_read_from_stream
4308+
/* {{{ exif_read_from_impl
43094309
*/
4310-
static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
4310+
static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
43114311
{
43124312
int ret;
43134313
zend_stat_t st;
@@ -4368,6 +4368,27 @@ static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream,
43684368
}
43694369
/* }}} */
43704370

4371+
/* {{{ exif_read_from_stream
4372+
*/
4373+
static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
4374+
{
4375+
int ret;
4376+
off_t old_pos = php_stream_tell(stream);
4377+
4378+
if (old_pos) {
4379+
php_stream_seek(stream, 0, SEEK_SET);
4380+
}
4381+
4382+
ret = exif_read_from_impl(ImageInfo, stream, read_thumbnail, read_all);
4383+
4384+
if (old_pos) {
4385+
php_stream_seek(stream, old_pos, SEEK_SET);
4386+
}
4387+
4388+
return ret;
4389+
}
4390+
/* }}} */
4391+
43714392
/* {{{ exif_read_from_file
43724393
*/
43734394
static int exif_read_from_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
@@ -4590,7 +4611,7 @@ PHP_FUNCTION(exif_read_data)
45904611
exif_discard_imageinfo(&ImageInfo);
45914612

45924613
#ifdef EXIF_DEBUG
4593-
php_error_docref1(NULL, p_name, E_NOTICE, "done");
4614+
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
45944615
#endif
45954616
}
45964617
/* }}} */
@@ -4672,7 +4693,7 @@ PHP_FUNCTION(exif_thumbnail)
46724693
exif_discard_imageinfo(&ImageInfo);
46734694

46744695
#ifdef EXIF_DEBUG
4675-
php_error_docref1(NULL, p_name, E_NOTICE, "Done");
4696+
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
46764697
#endif
46774698
}
46784699
/* }}} */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
exif_read_data() with streams seeking test
3+
--SKIPIF--
4+
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5+
--INI--
6+
output_handler=
7+
zlib.output_compression=0
8+
--FILE--
9+
<?php
10+
$fp = fopen(__DIR__ . '/image027.tiff', 'rb');
11+
12+
fseek($fp, 100, SEEK_SET);
13+
14+
exif_read_data($fp);
15+
16+
var_dump(ftell($fp) === 100);
17+
18+
fclose($fp);
19+
?>
20+
--EXPECT--
21+
bool(true)

ext/mbstring/oniguruma.patch

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
diff -wur oniguruma.orig/src/config.h.win32 oniguruma/src/config.h.win32
2+
--- oniguruma.orig/src/config.h.win32 2017-07-13 17:12:45.228068900 +0200
3+
+++ oniguruma/src/config.h.win32 2017-07-13 16:11:19.955226200 +0200
4+
@@ -15,6 +15,7 @@
5+
#define SIZEOF_VOIDP 4
6+
#define SIZEOF_FLOAT 4
7+
#define SIZEOF_DOUBLE 8
8+
+#define SIZEOF_SIZE_T 4
9+
#define HAVE_PROTOTYPES 1
10+
#define TOKEN_PASTE(x,y) x##y
11+
#define HAVE_STDARG_PROTOTYPES 1
12+
diff -wur oniguruma.orig/src/config.h.win64 oniguruma/src/config.h.win64
13+
--- oniguruma.orig/src/config.h.win64 2017-07-13 17:12:45.273605000 +0200
14+
+++ oniguruma/src/config.h.win64 2017-07-13 16:11:19.957231300 +0200
15+
@@ -15,6 +15,7 @@
16+
#define SIZEOF_VOIDP 8
17+
#define SIZEOF_FLOAT 4
18+
#define SIZEOF_DOUBLE 8
19+
+#define SIZEOF_SIZE_T 8
20+
#define HAVE_PROTOTYPES 1
21+
#define TOKEN_PASTE(x,y) x##y
22+
#define HAVE_STDARG_PROTOTYPES 1
23+
diff -wur oniguruma.orig/src/regint.h oniguruma/src/regint.h
24+
--- oniguruma.orig/src/regint.h 2017-07-13 17:12:48.686073300 +0200
25+
+++ oniguruma/src/regint.h 2017-07-13 17:13:28.032286100 +0200
26+
@@ -201,17 +201,21 @@
27+
} while(0)
28+
29+
/* sizeof(OnigCodePoint) */
30+
+#ifdef SIZEOF_SIZE_T
31+
+# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
32+
+#else
33+
#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
34+
+#endif
35+
36+
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
37+
(pad_size) = WORD_ALIGNMENT_SIZE \
38+
- - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
39+
+ - ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
40+
if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
41+
} while (0)
42+
43+
#define ALIGNMENT_RIGHT(addr) do {\
44+
(addr) += (WORD_ALIGNMENT_SIZE - 1);\
45+
- (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
46+
+ (addr) -= ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
47+
} while (0)
48+
49+
#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */
50+
@@ -662,7 +666,11 @@
51+
BBuf* mbuf; /* multi-byte info or NULL */
52+
} CClassNode;
53+
54+
+#ifdef _WIN64
55+
+typedef __int64 OnigStackIndex;
56+
+#else
57+
typedef long OnigStackIndex;
58+
+#endif
59+
60+
typedef struct _OnigStackType {
61+
unsigned int type;

ext/mbstring/oniguruma/src/regint.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@
201201
} while(0)
202202

203203
/* sizeof(OnigCodePoint) */
204-
#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
204+
#ifdef SIZEOF_SIZE_T
205+
# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
206+
#else
207+
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
208+
#endif
205209

206210
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
207211
(pad_size) = WORD_ALIGNMENT_SIZE \

ext/oci8/package.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Interoperability Support" (ID 207303.1) for details.
5050
<time>12:00:00</time>
5151

5252
<version>
53-
<release>2.1.5</release>
54-
<api>2.1.5</api>
53+
<release>2.1.6</release>
54+
<api>2.1.6</api>
5555
</version>
5656
<stability>
5757
<release>stable</release>
@@ -60,7 +60,6 @@ Interoperability Support" (ID 207303.1) for details.
6060
<license uri="http://www.php.net/license">PHP</license>
6161
<notes>
6262
This version is for PHP 7 only.
63-
Added TAF callback support (PR #2459, KoenigsKind)
6463
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
6564
</notes>
6665
<contents>
@@ -471,6 +470,22 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
471470
</extsrcrelease>
472471
<changelog>
473472

473+
<release>
474+
<version>
475+
<release>2.1.5</release>
476+
<api>2.1.5</api>
477+
</version>
478+
<stability>
479+
<release>stable</release>
480+
<api>stable</api>
481+
</stability>
482+
<license uri="http://www.php.net/license">PHP</license>
483+
<notes>
484+
This version is for PHP 7 only.
485+
Added TAF callback support (PR #2459, KoenigsKind)
486+
</notes>
487+
</release>
488+
474489
<release>
475490
<version>
476491
<release>2.1.4</release>

ext/oci8/php_oci8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*/
4444
#undef PHP_OCI8_VERSION
4545
#endif
46-
#define PHP_OCI8_VERSION "2.1.5"
46+
#define PHP_OCI8_VERSION "2.1.6"
4747

4848
extern zend_module_entry oci8_module_entry;
4949
#define phpext_oci8_ptr &oci8_module_entry

ext/oci8/tests/driver_name.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ function get_attr($conn)
5757
?>
5858
--EXPECT--
5959
**Test 1.1 - Default values for the attribute **************
60-
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
60+
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
6161

6262
***Test 1.2 - Get the values from different connections **************
6363
Testing with oci_pconnect()
64-
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
64+
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
6565
Testing with oci_new_connect()
66-
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
66+
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
6767
Done

ext/pcre/config0.m4

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,20 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality]
7878
fi
7979
fi
8080

81-
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
82-
Enable PCRE valgrind support. Developers only!], no, no)
81+
if test "$PHP_DEBUG" != "no" && test "$PHP_DEBUG" != "0"; then
82+
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
83+
Enable PCRE valgrind support. Developers only!], yes, no)
84+
else
85+
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
86+
Enable PCRE valgrind support. Developers only!], no, no)
87+
fi
88+
8389
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
8490
AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect])
8591
else
86-
if test "$PHP_PCRE_VALGRIND" != "no"; then
92+
if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "0"; then
93+
AC_MSG_NOTICE([PCRE Valgrind support is disabled for debug build])
94+
elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "0"; then
8795
PHP_PCRE_VALGRIND_INCDIR=
8896
AC_MSG_CHECKING([for Valgrind headers location])
8997
for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do

travis/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ else
55
TS="";
66
fi
77
if [[ "$ENABLE_DEBUG" == 1 ]]; then
8-
DEBUG="--enable-debug";
8+
DEBUG="--enable-debug --without-pcre-valgrind";
99
else
1010
DEBUG="";
1111
fi

0 commit comments

Comments
 (0)