mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-23 00:45:43 +00:00
Compare commits
81
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6bc51a449 | ||
|
|
78c931a55f | ||
|
|
9855bd6414 | ||
|
|
161b672b88 | ||
|
|
ee87db285f | ||
|
|
095a30e11b | ||
|
|
e111ef5626 | ||
|
|
2870178720 | ||
|
|
d207d6a57f | ||
|
|
cc69950b15 | ||
|
|
ce66492a13 | ||
|
|
ed7e3bc70a | ||
|
|
a96ca13963 | ||
|
|
40bd84d3e3 | ||
|
|
033dac7a6f | ||
|
|
2a181b5ea0 | ||
|
|
38d97557da | ||
|
|
c20a97df6d | ||
|
|
2139c2c2de | ||
|
|
33eb30274f | ||
|
|
99fdf5916e | ||
|
|
2073e96ec5 | ||
|
|
9e54d9d692 | ||
|
|
ca618a4f10 | ||
|
|
0510b47894 | ||
|
|
e5b27b9916 | ||
|
|
1ba3314335 | ||
|
|
b494d94f16 | ||
|
|
dfc2e3a2ac | ||
|
|
d011da9d1a | ||
|
|
c4106d4569 | ||
|
|
1127163996 | ||
|
|
b52c4fcbcd | ||
|
|
e069b0beba | ||
|
|
ebd5f56442 | ||
|
|
a536d6d61b | ||
|
|
4e92cd172a | ||
|
|
bddf8140e4 | ||
|
|
f151e048ed | ||
|
|
b73a108543 | ||
|
|
289cb0f77c | ||
|
|
3462efa386 | ||
|
|
1baeae4270 | ||
|
|
8efd3c3387 | ||
|
|
0f8c1ee76d | ||
|
|
dee191ee07 | ||
|
|
141072a838 | ||
|
|
f28aeaee05 | ||
|
|
99fe18503a | ||
|
|
77ced46dea | ||
|
|
236ae06e0b | ||
|
|
9443c61928 | ||
|
|
cc7b000d2c | ||
|
|
cc266045a5 | ||
|
|
98102648cb | ||
|
|
a766f65ca3 | ||
|
|
c23736216d | ||
|
|
9026562c79 | ||
|
|
ebb590b625 | ||
|
|
08f08858f3 | ||
|
|
474292c3e4 | ||
|
|
a820aab9da | ||
|
|
a6e8c73c43 | ||
|
|
2c43fb49d6 | ||
|
|
545a29d0cb | ||
|
|
ad790bea2e | ||
|
|
77a841db48 | ||
|
|
5d0d812a53 | ||
|
|
47fb17b108 | ||
|
|
d207fd449c | ||
|
|
1ae888d984 | ||
|
|
ea24847620 | ||
|
|
d85651d58d | ||
|
|
246cb03e26 | ||
|
|
3847a6fcb6 | ||
|
|
137f22ad36 | ||
|
|
268e801cb1 | ||
|
|
f3dc67b255 | ||
|
|
791f07e4f0 | ||
|
|
e5ef7cbe87 | ||
|
|
8bf21adb8c |
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.7beta1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.7
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
||||
@@ -1,6 +1,38 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.2.8
|
||||
16 Aug 2018, PHP 7.2.9
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #52974 (jewish.c: compile error under Windows with GBK charset).
|
||||
(cmb)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #76366 (References in sub-array for filtering breaks the filter).
|
||||
(ZiHang Gao)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #75402 (Possible Memory Leak using PDO::CURSOR_SCROLL option).
|
||||
(Anatol)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
|
||||
. Fixed bug #68553 (array_column: null values in $index_key become incrementing
|
||||
keys in result). (Laruence)
|
||||
. Fixed bug #76643 (Segmentation fault when using `output_add_rewrite_var`).
|
||||
(cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
|
||||
(Timur Ibragimov)
|
||||
|
||||
19 Jul 2018, PHP 7.2.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76534 (PHP hangs on 'illegal string offset on string references
|
||||
@@ -15,6 +47,10 @@ PHP NEWS
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #76409 (heap use after free in _php_stream_free). (cmb)
|
||||
. Fixed bug #76423 (Int Overflow lead to Heap OverFlow in
|
||||
exif_thumbnail_extract of exif.c). (Stas)
|
||||
. Fixed bug #76557 (heap-buffer-overflow (READ of size 48) while reading exif
|
||||
data). (Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
|
||||
@@ -53,6 +89,9 @@ PHP NEWS
|
||||
(Laruence)
|
||||
. Fixed bug #71848 (getimagesize with $imageinfo returns false). (cmb)
|
||||
|
||||
- Win32:
|
||||
. Fixed bug #76459 (windows linkinfo lacks openbasedir check). (Anatol)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #76461 (OPSYS_Z_CPM defined instead of OPSYS_CPM).
|
||||
(Dennis Birkholz, Remi)
|
||||
|
||||
+3
-3
@@ -60,7 +60,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#include <math.h>
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
@@ -69,7 +69,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
@@ -80,7 +80,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
|
||||
+8
-1
@@ -195,7 +195,14 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
|
||||
#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
|
||||
#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset))
|
||||
#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr))
|
||||
#define pefree_size(ptr, size, persistent) ((persistent)?free(ptr):efree_size(ptr, size))
|
||||
#define pefree_size(ptr, size, persistent) do { \
|
||||
if (persistent) { \
|
||||
free(ptr); \
|
||||
} else { \
|
||||
efree_size(ptr, size);\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
|
||||
#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size)))
|
||||
#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size)))
|
||||
|
||||
+5
-5
@@ -68,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#include <math.h>
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
@@ -77,7 +77,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
@@ -88,7 +88,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=7
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=9
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
+25
-25
@@ -340,38 +340,38 @@ char *JewishMonthName[14] =
|
||||
char *JewishMonthHebNameLeap[14] =
|
||||
{
|
||||
"",
|
||||
"úùøé",
|
||||
"çùåï",
|
||||
"ëñìå",
|
||||
"èáú",
|
||||
"ùáè",
|
||||
"àãø à'",
|
||||
"àãø á'",
|
||||
"ðéñï",
|
||||
"àééø",
|
||||
"ñéåï",
|
||||
"úîåæ",
|
||||
"àá",
|
||||
"àìåì"
|
||||
"\xFA\xF9\xF8\xE9",
|
||||
"\xE7\xF9\xE5\xEF",
|
||||
"\xEB\xF1\xEC\xE5",
|
||||
"\xE8\xE1\xFA",
|
||||
"\xF9\xE1\xE8",
|
||||
"\xE0\xE3\xF8 \xE0'",
|
||||
"\xE0\xE3\xF8 \xE1'",
|
||||
"\xF0\xE9\xF1\xEF",
|
||||
"\xE0\xE9\xE9\xF8",
|
||||
"\xF1\xE9\xe5\xEF",
|
||||
"\xFA\xEE\xE5\xE6",
|
||||
"\xE0\xE1",
|
||||
"\xE0\xEC\xE5\xEC"
|
||||
};
|
||||
|
||||
/* names for regular year */
|
||||
char *JewishMonthHebName[14] =
|
||||
{
|
||||
"",
|
||||
"úùøé",
|
||||
"çùåï",
|
||||
"ëñìå",
|
||||
"èáú",
|
||||
"ùáè",
|
||||
"\xFA\xF9\xF8\xE9",
|
||||
"\xE7\xF9\xE5\xEF",
|
||||
"\xEB\xF1\xEC\xE5",
|
||||
"\xE8\xE1\xFA",
|
||||
"\xF9\xE1\xE8",
|
||||
"",
|
||||
"àãø",
|
||||
"ðéñï",
|
||||
"àééø",
|
||||
"ñéåï",
|
||||
"úîåæ",
|
||||
"àá",
|
||||
"àìåì"
|
||||
"\xE0\xE3\xF8",
|
||||
"\xF0\xE9\xF1\xEF",
|
||||
"\xE0\xE9\xE9\xF8",
|
||||
"\xF1\xE9\xE5\xEF",
|
||||
"\xFA\xEE\xE5\xE6",
|
||||
"\xE0\xE1",
|
||||
"\xE0\xEC\xE5\xEC"
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Test all hebrew month names
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip calendar extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
for ($year = 5000; $year <= 5001; $year++) {
|
||||
$leap = ($year === 5001) ? 'leap' : 'normal';
|
||||
echo "$leap year $year\n";
|
||||
for ($month = 1; $month <= 13; $month++) {
|
||||
$jd = jewishtojd($month, 1, $year);
|
||||
$hebrew = jdtojewish($jd, true);
|
||||
$hex = bin2hex($hebrew);
|
||||
echo "$hex\n";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
normal year 5000
|
||||
e020faf9f8e920e4
|
||||
e020e7f9e5ef20e4
|
||||
e020ebf1ece520e4
|
||||
e020e8e1fa20e4
|
||||
e020f9e1e820e4
|
||||
e020e0e3f820e02720e4
|
||||
e020e0e3f820e12720e4
|
||||
e020f0e9f1ef20e4
|
||||
e020e0e9e9f820e4
|
||||
e020f1e9e5ef20e4
|
||||
e020faeee5e620e4
|
||||
e020e0e120e4
|
||||
e020e0ece5ec20e4
|
||||
|
||||
leap year 5001
|
||||
e020faf9f8e920e4e0
|
||||
e020e7f9e5ef20e4e0
|
||||
e020ebf1ece520e4e0
|
||||
e020e8e1fa20e4e0
|
||||
e020f9e1e820e4e0
|
||||
e020e0e3f820e4e0
|
||||
e020e0e3f820e4e0
|
||||
e020f0e9f1ef20e4e0
|
||||
e020e0e9e9f820e4e0
|
||||
e020f1e9e5ef20e4e0
|
||||
e020faeee5e620e4e0
|
||||
e020e0e120e4e0
|
||||
e020e0ece5ec20e4e0
|
||||
|
||||
===DONE===
|
||||
@@ -42,7 +42,11 @@ struct _notationIterator {
|
||||
xmlNotation *notation;
|
||||
};
|
||||
|
||||
static void itemHashScanner (void *payload, void *data, xmlChar *name) /* {{{ */
|
||||
#if LIBXML_VERSION >= 20908
|
||||
static void itemHashScanner (void *payload, void *data, const xmlChar *name) /* {{{ */
|
||||
#else
|
||||
static void itemHashScanner (void *payload, void *data, xmlChar *name)
|
||||
#endif
|
||||
{
|
||||
nodeIterator *priv = (nodeIterator *)data;
|
||||
|
||||
|
||||
+9
-3
@@ -2944,7 +2944,10 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
|
||||
return;
|
||||
}
|
||||
/* Check to make sure we are not going to go past the ExifLength */
|
||||
if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) {
|
||||
if (ImageInfo->Thumbnail.size > length
|
||||
|| (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length
|
||||
|| ImageInfo->Thumbnail.offset > length - ImageInfo->Thumbnail.size
|
||||
) {
|
||||
EXIF_ERRLOG_THUMBEOF(ImageInfo)
|
||||
return;
|
||||
}
|
||||
@@ -3126,7 +3129,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
#endif
|
||||
const maker_note_type *maker_note;
|
||||
char *dir_start;
|
||||
|
||||
int data_len;
|
||||
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -3180,6 +3184,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
switch (maker_note->offset_mode) {
|
||||
case MN_OFFSET_MAKER:
|
||||
offset_base = value_ptr;
|
||||
data_len = value_len;
|
||||
break;
|
||||
#ifdef KALLE_0
|
||||
case MN_OFFSET_GUESS:
|
||||
@@ -3197,6 +3202,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
return FALSE;
|
||||
}
|
||||
offset_base = value_ptr + offset_diff;
|
||||
data_len = value_len - offset_diff;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -3211,7 +3217,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #76423 (Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76423.jpg', 0, true, true);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Thumbnail goes IFD boundary or end of file reached in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Invalid JPEG file in %s on line %d
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -0,0 +1,79 @@
|
||||
--TEST--
|
||||
Bug 76557 (heap-buffer-overflow (READ of size 48) while reading exif data)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(dirname(__FILE__) . "/bug76557.jpg"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x010F=Make ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x8769=Exif_IFD_Po): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x927C=MakerNote ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Invalid JPEG file in %sbug76557.php on line %d
|
||||
bool(false)
|
||||
DONE
|
||||
@@ -621,6 +621,9 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
|
||||
}
|
||||
|
||||
if ((option = zend_hash_str_find(HASH_OF(filter_args), "options", sizeof("options") - 1)) != NULL) {
|
||||
/* avoid reference type */
|
||||
ZVAL_DEREF(option);
|
||||
|
||||
if (filter != FILTER_CALLBACK) {
|
||||
if (Z_TYPE_P(option) == IS_ARRAY) {
|
||||
options = option;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76366 (references in sub-array for filtering breaks the filter)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('filter')) die('skip filter extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
#array to filter
|
||||
$data = ['foo' => 6];
|
||||
|
||||
#filter args
|
||||
$args = [
|
||||
'foo'=> [
|
||||
'filter' => FILTER_VALIDATE_INT,
|
||||
'flags' => FILTER_FORCE_ARRAY
|
||||
]
|
||||
];
|
||||
|
||||
$args['foo']['options'] = [];
|
||||
|
||||
#create reference
|
||||
$options = &$args['foo']['options'];
|
||||
|
||||
#set options
|
||||
$options['min_range'] = 1;
|
||||
$options['max_range'] = 5;
|
||||
|
||||
#show the filter result
|
||||
var_dump(filter_var_array($data, $args));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
bool(false)
|
||||
}
|
||||
}
|
||||
@@ -294,7 +294,7 @@ static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ *
|
||||
unsigned short seg_len;
|
||||
ISC_STATUS stat;
|
||||
|
||||
*ptr = S->fetch_buf[colno] = erealloc(*ptr, *len+1);
|
||||
*ptr = S->fetch_buf[colno] = erealloc(S->fetch_buf[colno], *len+1);
|
||||
|
||||
for (cur_len = stat = 0; (!stat || stat == isc_segment) && cur_len < *len; cur_len += seg_len) {
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
PDO_Firebird: Bug #76488 Memory leak when fetching a BLOB field
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'testdb.inc';
|
||||
$dbh = new PDO('firebird:dbname='.$test_base, $user, $password) or die;
|
||||
|
||||
$sql = '
|
||||
with recursive r(n) as (
|
||||
select 1 from rdb$database
|
||||
union all
|
||||
select n+1 from r where n < 1000
|
||||
)
|
||||
select n,
|
||||
cast(lpad(\'A\', 8000, \'A\') as BLOB sub_type TEXT) as SRC
|
||||
from r
|
||||
';
|
||||
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$sth = $dbh->prepare($sql);
|
||||
$sth->execute();
|
||||
$rows = $sth->fetchAll();
|
||||
unset($rows);
|
||||
unset($sth);
|
||||
}
|
||||
unset($dbh);
|
||||
echo "OK";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -11,6 +11,9 @@ if (PHP_PDO_PGSQL != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("pg_config.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) {
|
||||
ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_CONFIG_H");
|
||||
}
|
||||
if (X64) {
|
||||
ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_LO64=1");
|
||||
}
|
||||
|
||||
AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library');
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
|
||||
pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result));
|
||||
return 0;
|
||||
}
|
||||
PQclear(S->result);
|
||||
|
||||
/* the cursor was declared correctly */
|
||||
S->is_prepared = 1;
|
||||
@@ -434,6 +435,11 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(S->result) {
|
||||
PQclear(S->result);
|
||||
S->result = NULL;
|
||||
}
|
||||
|
||||
spprintf(&q, 0, "FETCH %s FROM %s", ori_str, S->cursor_name);
|
||||
efree(ori_str);
|
||||
S->result = PQexec(S->H->server, q);
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
--TEST--
|
||||
PDO PgSQL Bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
||||
require dirname(__FILE__) . '/config.inc';
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
|
||||
|
||||
$resp = new \stdClass();
|
||||
$resp->entries = [];
|
||||
|
||||
$db->query('DROP TABLE IF EXISTS bug75402 CASCADE');
|
||||
$db->query('CREATE TABLE bug75402 (
|
||||
"id" character varying(64) NOT NULL,
|
||||
"group_id" character varying(64) NOT NULL,
|
||||
"submitter" character varying(320) NOT NULL,
|
||||
"operation" character varying(32) NOT NULL,
|
||||
"description" character varying(320) NOT NULL,
|
||||
"stage" character varying(16) NOT NULL,
|
||||
"status" character varying(64) NOT NULL,
|
||||
"progress" integer NOT NULL,
|
||||
"insert_datetime" timestamp(3) NOT NULL,
|
||||
"begin_datetime" timestamp(3),
|
||||
"end_datetime" timestamp(3),
|
||||
"life_hours" integer NOT NULL,
|
||||
"family" character varying(32) NOT NULL,
|
||||
"parallelism_group" character varying(32) NOT NULL,
|
||||
"max_parallelism" integer NOT NULL,
|
||||
"hidden" boolean NOT NULL,
|
||||
"abort" boolean NOT NULL,
|
||||
"order_folder_pathname" character varying(320),
|
||||
"worker" character varying(32) NOT NULL,
|
||||
CONSTRAINT "pk_bug75402" PRIMARY KEY ("id")
|
||||
) WITH (oids = false);');
|
||||
|
||||
|
||||
|
||||
$db->query("INSERT INTO bug75402 (\"id\", \"group_id\", \"submitter\", \"operation\", \"description\", \"stage\", \"status\", \"progress\", \"insert_datetime\", \"begin_datetime\", \"end_datetime\", \"life_hours\", \"family\", \"parallelism_group\", \"max_parallelism\", \"hidden\", \"abort\", \"order_folder_pathname\", \"worker\") VALUES
|
||||
('20171016083645_5337', 'G_20171016083645_5337', 'TESTPetunia', 'IMPORT', '', 'DON', 'Completed', 100, '2017-10-16 08:36:45', '2017-10-16 08:36:46', '2017-10-16 08:36:46', 96, 'IMPORT', '', -1, 'f', 'f', 'C:\ProgramData\TestPath\TestApp\Jobs\Jobs\\20171016083645_5337', 'MainService')");
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT
|
||||
ID as \"sID\",
|
||||
GROUP_ID as \"sGroupID\",
|
||||
SUBMITTER as \"sOwner\",
|
||||
OPERATION as \"sOperation\",
|
||||
DESCRIPTION as \"sInfo\",
|
||||
STAGE as \"sShortStatus\",
|
||||
STATUS as \"sStatus\",
|
||||
PROGRESS as \"sProgress\",
|
||||
HIDDEN as \"bHidden\",
|
||||
to_char(INSERT_DATETIME, 'IYYY.MM.DD HH24:MI:SS') as \"sDatetime\"
|
||||
FROM bug75402
|
||||
ORDER BY INSERT_DATETIME DESC";
|
||||
|
||||
if ($db) {
|
||||
$stmt = $db->prepare($sql,
|
||||
array(
|
||||
// With the following options memory is not being
|
||||
// deallocated
|
||||
\PDO::ATTR_CURSOR => \PDO::CURSOR_SCROLL
|
||||
// With the following option memory is de-allocated
|
||||
// \PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY
|
||||
)
|
||||
);
|
||||
$stmt->execute();
|
||||
|
||||
while ($entry = $stmt->fetchObject()) {
|
||||
$resp->entries [] = $entry;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
$stmt = null;
|
||||
$db = null;
|
||||
}
|
||||
|
||||
var_dump($resp);
|
||||
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["entries"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(stdClass)#4 (10) {
|
||||
["sid"]=>
|
||||
string(19) "20171016083645_5337"
|
||||
["sgroupid"]=>
|
||||
string(21) "G_20171016083645_5337"
|
||||
["sowner"]=>
|
||||
string(11) "TESTPetunia"
|
||||
["soperation"]=>
|
||||
string(6) "IMPORT"
|
||||
["sinfo"]=>
|
||||
string(0) ""
|
||||
["sshortstatus"]=>
|
||||
string(3) "DON"
|
||||
["sstatus"]=>
|
||||
string(9) "Completed"
|
||||
["sprogress"]=>
|
||||
string(3) "100"
|
||||
["bhidden"]=>
|
||||
bool(false)
|
||||
["sdatetime"]=>
|
||||
string(19) "2017.10.16 08:36:45"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1595,7 +1595,7 @@ PHP_METHOD(sqlite3stmt, execute)
|
||||
break;
|
||||
|
||||
case SQLITE_FLOAT:
|
||||
/* convert_to_double(parameter);*/
|
||||
convert_to_double(parameter);
|
||||
sqlite3_bind_double(stmt_obj->stmt, param->param_number, Z_DVAL_P(parameter));
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('sqlite3')) die('skip sqlite3 extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$db = new SQLite3(':memory:');
|
||||
$db->exec("CREATE TABLE foo (bar REAL)");
|
||||
$stmt = $db->prepare("INSERT INTO foo VALUES (:bar)");
|
||||
$stmt->bindValue(':bar', 17, SQLITE3_FLOAT);
|
||||
$stmt->execute();
|
||||
var_dump($db->querySingle("SELECT bar FROM foo LIMIT 1"));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
float(17)
|
||||
===DONE===
|
||||
+32
-10
@@ -4228,16 +4228,38 @@ PHP_FUNCTION(array_column)
|
||||
zkeyval = array_column_fetch_prop(data, zkey, &rvk);
|
||||
}
|
||||
if (zkeyval) {
|
||||
if (Z_TYPE_P(zkeyval) == IS_STRING) {
|
||||
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(zkeyval), zcolval);
|
||||
} else if (Z_TYPE_P(zkeyval) == IS_LONG) {
|
||||
add_index_zval(return_value, Z_LVAL_P(zkeyval), zcolval);
|
||||
} else if (Z_TYPE_P(zkeyval) == IS_OBJECT) {
|
||||
zend_string *key = zval_get_string(zkeyval);
|
||||
zend_symtable_update(Z_ARRVAL_P(return_value), key, zcolval);
|
||||
zend_string_release(key);
|
||||
} else {
|
||||
add_next_index_zval(return_value, zcolval);
|
||||
switch (Z_TYPE_P(zkeyval)) {
|
||||
case IS_STRING:
|
||||
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(zkeyval), zcolval);
|
||||
break;
|
||||
case IS_LONG:
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(zkeyval), zcolval);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
{
|
||||
zend_string *key = zval_get_string(zkeyval);
|
||||
zend_symtable_update(Z_ARRVAL_P(return_value), key, zcolval);
|
||||
zend_string_release(key);
|
||||
break;
|
||||
}
|
||||
case IS_NULL:
|
||||
zend_hash_update(Z_ARRVAL_P(return_value), ZSTR_EMPTY_ALLOC(), zcolval);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), zend_dval_to_lval(Z_DVAL_P(zkeyval)), zcolval);
|
||||
break;
|
||||
case IS_TRUE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), 1, zcolval);
|
||||
break;
|
||||
case IS_FALSE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), 0, zcolval);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_RES_HANDLE_P(zkeyval), zcolval);
|
||||
break;
|
||||
default:
|
||||
add_next_index_zval(return_value, zcolval);
|
||||
break;
|
||||
}
|
||||
if (zkeyval == &rvk) {
|
||||
zval_ptr_dtor(&rvk);
|
||||
|
||||
+18
-13
@@ -176,12 +176,14 @@ typedef struct _php_strip_tags_filter {
|
||||
uint8_t persistent;
|
||||
} php_strip_tags_filter;
|
||||
|
||||
static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, size_t allowed_tags_len, int persistent)
|
||||
static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, zend_string *allowed_tags, int persistent)
|
||||
{
|
||||
if (allowed_tags != NULL) {
|
||||
inst->allowed_tags = pemalloc(allowed_tags_len, persistent);
|
||||
memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len);
|
||||
inst->allowed_tags_len = (int)allowed_tags_len;
|
||||
if (NULL == (inst->allowed_tags = pemalloc(ZSTR_LEN(allowed_tags) + 1, persistent))) {
|
||||
return FAILURE;
|
||||
}
|
||||
memcpy((char *)inst->allowed_tags, ZSTR_VAL(allowed_tags), ZSTR_LEN(allowed_tags) + 1);
|
||||
inst->allowed_tags_len = (int)ZSTR_LEN(allowed_tags);
|
||||
} else {
|
||||
inst->allowed_tags = NULL;
|
||||
}
|
||||
@@ -245,12 +247,14 @@ static php_stream_filter_ops strfilter_strip_tags_ops = {
|
||||
static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, uint8_t persistent)
|
||||
{
|
||||
php_strip_tags_filter *inst;
|
||||
smart_str tags_ss = {0};
|
||||
php_stream_filter *filter = NULL;
|
||||
zend_string *allowed_tags = NULL;;
|
||||
|
||||
inst = pemalloc(sizeof(php_strip_tags_filter), persistent);
|
||||
|
||||
if (filterparams != NULL) {
|
||||
if (Z_TYPE_P(filterparams) == IS_ARRAY) {
|
||||
smart_str tags_ss = {0};
|
||||
zval *tmp;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(filterparams), tmp) {
|
||||
@@ -260,22 +264,23 @@ static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zv
|
||||
smart_str_appendc(&tags_ss, '>');
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
smart_str_0(&tags_ss);
|
||||
allowed_tags = tags_ss.s;
|
||||
} else {
|
||||
/* FIXME: convert_to_* may clutter zvals and lead it into segfault ? */
|
||||
convert_to_string_ex(filterparams);
|
||||
smart_str_setl(&tags_ss, Z_STRVAL_P(filterparams), Z_STRLEN_P(filterparams));
|
||||
allowed_tags = zval_get_string(filterparams);
|
||||
}
|
||||
}
|
||||
|
||||
if (php_strip_tags_filter_ctor(inst, ZSTR_VAL(tags_ss.s), ZSTR_LEN(tags_ss.s), persistent) != SUCCESS) {
|
||||
smart_str_free(&tags_ss);
|
||||
if (php_strip_tags_filter_ctor(inst, allowed_tags, persistent) == SUCCESS) {
|
||||
filter = php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
|
||||
} else {
|
||||
pefree(inst, persistent);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
smart_str_free(&tags_ss);
|
||||
if (allowed_tags) {
|
||||
zend_string_release(allowed_tags);
|
||||
}
|
||||
|
||||
return php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
|
||||
return filter;
|
||||
}
|
||||
|
||||
static php_stream_filter_factory strfilter_strip_tags_factory = {
|
||||
|
||||
+1
-2
@@ -1595,8 +1595,7 @@ static inline void write_s3row_data(
|
||||
written_k2 = write_octet_sequence((unsigned char*)&key[written_k1], charset, spe_cp);
|
||||
memcpy(&entity[1], mcpr[i].normal_entry.entity, l);
|
||||
entity[l + 1] = ';';
|
||||
entity[l + 1] = '\0';
|
||||
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 1);
|
||||
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ PHP_FUNCTION(readlink)
|
||||
PHP_FUNCTION(linkinfo)
|
||||
{
|
||||
char *link;
|
||||
char *dirname;
|
||||
size_t link_len;
|
||||
zend_stat_t sb;
|
||||
int ret;
|
||||
@@ -95,12 +96,22 @@ PHP_FUNCTION(linkinfo)
|
||||
return;
|
||||
}
|
||||
|
||||
dirname = estrndup(link, link_len);
|
||||
php_dirname(dirname, link_len);
|
||||
|
||||
if (php_check_open_basedir(dirname)) {
|
||||
efree(dirname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret = VCWD_STAT(link, &sb);
|
||||
if (ret == -1) {
|
||||
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
|
||||
efree(dirname);
|
||||
RETURN_LONG(Z_L(-1));
|
||||
}
|
||||
|
||||
efree(dirname);
|
||||
RETURN_LONG((zend_long) sb.st_dev);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
--TEST--
|
||||
Bug #68553 (array_column: null values in $index_key become incrementing keys in result)
|
||||
--FILE--
|
||||
<?php
|
||||
$i = 100;
|
||||
/* increase the resource id to make test stable */
|
||||
while ($i--) {
|
||||
$fd = fopen(__FILE__, "r");
|
||||
fclose($fd);
|
||||
}
|
||||
$a = [
|
||||
['a' => 10],
|
||||
['a' => 20],
|
||||
['a' => true],
|
||||
['a' => false],
|
||||
['a' => fopen(__FILE__, "r")],
|
||||
['a' => -5],
|
||||
['a' => 7.38],
|
||||
['a' => null, "test"],
|
||||
['a' => null],
|
||||
];
|
||||
|
||||
var_dump(array_column($a, null, 'a'));
|
||||
--EXPECTF--
|
||||
array(8) {
|
||||
[10]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
int(10)
|
||||
}
|
||||
[20]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
int(20)
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
bool(true)
|
||||
}
|
||||
[0]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
bool(false)
|
||||
}
|
||||
[%d]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
resource(%d) of type (stream)
|
||||
}
|
||||
[-5]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
int(-5)
|
||||
}
|
||||
[7]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
float(7.38)
|
||||
}
|
||||
[""]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
--TEST--
|
||||
RecursiveDirectoryIterator with dir path long or of edge case length
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
skip_if_not_win();
|
||||
|
||||
if (strlen(dirname(__FILE__)) > 259) die("Unsuitable starting path length");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$need_len = 1024;
|
||||
//$need_len = 259;
|
||||
$dir = dirname(__FILE__);
|
||||
while ($need_len - strlen($dir) > 32) {
|
||||
$dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32);
|
||||
}
|
||||
$dir .= DIRECTORY_SEPARATOR . str_repeat("a", $need_len - strlen($dir));
|
||||
mkdir($dir, 0700, true);
|
||||
|
||||
$fl = $dir . DIRECTORY_SEPARATOR . "hello.txt";
|
||||
file_put_contents($fl, "");
|
||||
|
||||
|
||||
$start = substr($dir, 0, strpos($dir, DIRECTORY_SEPARATOR, strlen(dirname(__FILE__))+1));
|
||||
$iter = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator(
|
||||
$start,
|
||||
FilesystemIterator::SKIP_DOTS
|
||||
),
|
||||
RecursiveIteratorIterator::CHILD_FIRST
|
||||
);
|
||||
|
||||
foreach ($iter as $item) {
|
||||
if (!$item->isDir()) {
|
||||
var_dump($item->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
$iter->rewind();
|
||||
foreach ($iter as $item) {
|
||||
if ($item->isDir()) {
|
||||
rmdir($item->getPathname());
|
||||
} else {
|
||||
unlink($item->getPathname());
|
||||
}
|
||||
}
|
||||
rmdir($start);
|
||||
var_dump(file_exists($start));
|
||||
|
||||
/*unlink($fl);
|
||||
do {
|
||||
rmdir($dir);
|
||||
$dir = dirname($dir);
|
||||
} while (dirname(__FILE__) != $dir);*/
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
string(%d) "%shello.txt"
|
||||
bool(false)
|
||||
==DONE==
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
string.strip_tags filter
|
||||
--FILE--
|
||||
<?php
|
||||
$fp = fopen('php://output', 'w');
|
||||
stream_filter_append($fp, 'string.strip_tags');
|
||||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
|
||||
fclose($fp);
|
||||
|
||||
$fp = fopen('php://output', 'w');
|
||||
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, "<b>");
|
||||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
|
||||
fclose($fp);
|
||||
|
||||
$fp = fopen('php://output', 'w');
|
||||
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, ["b"]);
|
||||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n");
|
||||
fclose($fp);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test bold italic test
|
||||
test <b>bold</b> italic test
|
||||
test <b>bold</b> italic test
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #76643 (Segmentation fault when using `output_add_rewrite_var`)
|
||||
--FILE--
|
||||
<?php
|
||||
$_SERVER = 'foo';
|
||||
output_add_rewrite_var('bar', 'baz');
|
||||
?>
|
||||
<form action="http://example.com/"></form>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
<form action="http://example.com/"></form>
|
||||
===DONE===
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #73817 (Incorrect entries in get_html_translation_table)
|
||||
--FILE--
|
||||
<?php
|
||||
$entities = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES | ENT_HTML5);
|
||||
foreach ($entities as $entity) {
|
||||
if (substr($entity, -1) !== ';') {
|
||||
var_dump($entity);
|
||||
}
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -273,27 +273,27 @@ Array
|
||||
[≢] => ≢
|
||||
[≭] => ≭
|
||||
[≠] => ≠
|
||||
[≧̸] => &NotGreaterFullEqual
|
||||
[≫̸] => &NotGreaterGreater
|
||||
[≧̸] => ≧̸
|
||||
[≫̸] => ≫̸
|
||||
[≹] => ≹
|
||||
[⧏̸] => &NotLeftTriangleBar
|
||||
[⧏̸] => ⧏̸
|
||||
[≮] => ≮
|
||||
[≰] => ≰
|
||||
[⪢̸] => &NotNestedGreaterGreater
|
||||
[⪡̸] => &NotNestedLessLess
|
||||
[⪯̸] => &NotPrecedesEqual
|
||||
[⪢̸] => ⪢̸
|
||||
[⪡̸] => ⪡̸
|
||||
[⪯̸] => ⪯̸
|
||||
[⋠] => ⋠
|
||||
[⧐̸] => &NotRightTriangleBar
|
||||
[⧐̸] => ⧐̸
|
||||
[⋭] => ⋭
|
||||
[⊏̸] => &NotSquareSubset
|
||||
[⊏̸] => ⊏̸
|
||||
[⋢] => ⋢
|
||||
[⊐̸] => &NotSquareSuperset
|
||||
[⊐̸] => ⊐̸
|
||||
[⋣] => ⋣
|
||||
[⊈] => ⊈
|
||||
[⊁] => ⊁
|
||||
[⪰̸] => &NotSucceedsEqual
|
||||
[⪰̸] => ⪰̸
|
||||
[⋡] => ⋡
|
||||
[≿̸] => &NotSucceedsTilde
|
||||
[≿̸] => ≿̸
|
||||
[⊉] => ⊉
|
||||
[≁] => ≁
|
||||
[𝒩] => 𝒩
|
||||
@@ -394,7 +394,7 @@ Array
|
||||
[Т] => Т
|
||||
[𝔗] => 𝔗
|
||||
[Θ] => Θ
|
||||
[ ] => &ThickSpace
|
||||
[ ] =>   
|
||||
[ ] =>  
|
||||
[≅] => ≅
|
||||
[𝕋] => 𝕋
|
||||
@@ -469,7 +469,7 @@ Array
|
||||
[á] => á
|
||||
[ă] => ă
|
||||
[∾] => ∾
|
||||
[∾̳] => &acE
|
||||
[∾̳] => ∾̳
|
||||
[∿] => ∿
|
||||
[â] => â
|
||||
[а] => а
|
||||
@@ -552,8 +552,8 @@ Array
|
||||
[░] => ░
|
||||
[▓] => ▓
|
||||
[█] => █
|
||||
[=⃥] => &bne
|
||||
[≡⃥] => &bnequiv
|
||||
[=⃥] => =⃥
|
||||
[≡⃥] => ≡⃥
|
||||
[⌐] => ⌐
|
||||
[𝕓] => 𝕓
|
||||
[⋈] => ⋈
|
||||
@@ -616,7 +616,7 @@ Array
|
||||
[⩋] => ⩋
|
||||
[⩇] => ⩇
|
||||
[⩀] => ⩀
|
||||
[∩︀] => &caps
|
||||
[∩︀] => ∩︀
|
||||
[⁁] => ⁁
|
||||
[⩍] => ⩍
|
||||
[č] => č
|
||||
@@ -668,7 +668,7 @@ Array
|
||||
[⩊] => ⩊
|
||||
[⊍] => ⊍
|
||||
[⩅] => ⩅
|
||||
[∪︀] => &cups
|
||||
[∪︀] => ∪︀
|
||||
[↷] => ↷
|
||||
[⤼] => ⤼
|
||||
[⋞] => ⋞
|
||||
@@ -772,7 +772,7 @@ Array
|
||||
[ffl] => ffl
|
||||
[𝔣] => 𝔣
|
||||
[fi] => fi
|
||||
[fj] => &fjlig
|
||||
[fj] => fj
|
||||
[♭] => ♭
|
||||
[fl] => fl
|
||||
[▱] => ▱
|
||||
@@ -814,7 +814,7 @@ Array
|
||||
[⪀] => ⪀
|
||||
[⪂] => ⪂
|
||||
[⪄] => ⪄
|
||||
[⋛︀] => &gesl
|
||||
[⋛︀] => ⋛︀
|
||||
[⪔] => ⪔
|
||||
[𝔤] => 𝔤
|
||||
[≫] => ≫
|
||||
@@ -841,7 +841,7 @@ Array
|
||||
[⥸] => ⥸
|
||||
[⋗] => ⋗
|
||||
[⋛] => ⋛
|
||||
[≩︀] => &gvertneqq
|
||||
[≩︀] => ≩︀
|
||||
[⇔] => ⇔
|
||||
[ ] =>  
|
||||
[½] => ½
|
||||
@@ -940,7 +940,7 @@ Array
|
||||
[⪫] => ⪫
|
||||
[⤙] => ⤙
|
||||
[⪭] => ⪭
|
||||
[⪭︀] => &lates
|
||||
[⪭︀] => ⪭︀
|
||||
[⤌] => ⤌
|
||||
[❲] => ❲
|
||||
[{] => {
|
||||
@@ -965,7 +965,7 @@ Array
|
||||
[⩿] => ⩿
|
||||
[⪁] => ⪁
|
||||
[⪃] => ⪃
|
||||
[⋚︀] => &lesg
|
||||
[⋚︀] => ⋚︀
|
||||
[⪓] => ⪓
|
||||
[⋖] => ⋖
|
||||
[⋚] => ⋚
|
||||
@@ -1022,7 +1022,7 @@ Array
|
||||
[◃] => ◃
|
||||
[⥊] => ⥊
|
||||
[⥦] => ⥦
|
||||
[≨︀] => &lvertneqq
|
||||
[≨︀] => ≨︀
|
||||
[∺] => ∺
|
||||
[¯] => ¯
|
||||
[♂] => ♂
|
||||
@@ -1046,42 +1046,42 @@ Array
|
||||
[𝓂] => 𝓂
|
||||
[μ] => μ
|
||||
[⊸] => ⊸
|
||||
[⋙̸] => &nGg
|
||||
[≫⃒] => &nGt
|
||||
[⋙̸] => ⋙̸
|
||||
[≫⃒] => ≫⃒
|
||||
[⇍] => ⇍
|
||||
[⋘̸] => &nLl
|
||||
[≪⃒] => &nLt
|
||||
[≪̸] => &nLtv
|
||||
[⋘̸] => ⋘̸
|
||||
[≪⃒] => ≪⃒
|
||||
[≪̸] => ≪̸
|
||||
[⊯] => ⊯
|
||||
[⊮] => ⊮
|
||||
[∇] => ∇
|
||||
[ń] => ń
|
||||
[∠⃒] => &nang
|
||||
[⩰̸] => &napE
|
||||
[≋̸] => &napid
|
||||
[∠⃒] => ∠⃒
|
||||
[⩰̸] => ⩰̸
|
||||
[≋̸] => ≋̸
|
||||
[ʼn] => ʼn
|
||||
[≉] => ≉
|
||||
[♮] => ♮
|
||||
[ℕ] => ℕ
|
||||
[ ] =>
|
||||
[≎̸] => &nbump
|
||||
[≏̸] => &nbumpe
|
||||
[≎̸] => ≎̸
|
||||
[≏̸] => ≏̸
|
||||
[⩃] => ⩃
|
||||
[ň] => ň
|
||||
[ņ] => ņ
|
||||
[≇] => ≇
|
||||
[⩭̸] => &ncongdot
|
||||
[⩭̸] => ⩭̸
|
||||
[⩂] => ⩂
|
||||
[н] => н
|
||||
[–] => –
|
||||
[⇗] => ⇗
|
||||
[⤤] => ⤤
|
||||
[≐̸] => &nedot
|
||||
[≂̸] => &nesim
|
||||
[≐̸] => ≐̸
|
||||
[≂̸] => ≂̸
|
||||
[∄] => ∄
|
||||
[𝔫] => 𝔫
|
||||
[≱] => ≱
|
||||
[⩾̸] => &nges
|
||||
[⩾̸] => ⩾̸
|
||||
[≵] => ≵
|
||||
[≯] => ≯
|
||||
[⇎] => ⇎
|
||||
@@ -1089,41 +1089,41 @@ Array
|
||||
[⋼] => ⋼
|
||||
[⋺] => ⋺
|
||||
[њ] => њ
|
||||
[≦̸] => &nlE
|
||||
[≦̸] => ≦̸
|
||||
[‥] => ‥
|
||||
[↚] => ↚
|
||||
[↮] => ↮
|
||||
[⩽̸] => &nles
|
||||
[⩽̸] => ⩽̸
|
||||
[≴] => ≴
|
||||
[⋪] => ⋪
|
||||
[⋬] => ⋬
|
||||
[𝕟] => 𝕟
|
||||
[¬] => ¬
|
||||
[∉] => ∉
|
||||
[⋹̸] => ¬inE
|
||||
[⋵̸] => ¬indot
|
||||
[⋹̸] => ⋹̸
|
||||
[⋵̸] => ⋵̸
|
||||
[⋷] => ⋷
|
||||
[⋶] => ⋶
|
||||
[∌] => ∌
|
||||
[⋾] => ⋾
|
||||
[⋽] => ⋽
|
||||
[∦] => ∦
|
||||
[⫽⃥] => &nparsl
|
||||
[∂̸] => &npart
|
||||
[⫽⃥] => ⫽⃥
|
||||
[∂̸] => ∂̸
|
||||
[⨔] => ⨔
|
||||
[⊀] => ⊀
|
||||
[⇏] => ⇏
|
||||
[↛] => ↛
|
||||
[⤳̸] => &nrarrc
|
||||
[↝̸] => &nrarrw
|
||||
[⤳̸] => ⤳̸
|
||||
[↝̸] => ↝̸
|
||||
[𝓃] => 𝓃
|
||||
[∤] => ∤
|
||||
[≄] => ≄
|
||||
[⊄] => ⊄
|
||||
[⫅̸] => &nsubE
|
||||
[⫅̸] => ⫅̸
|
||||
[⊅] => ⊅
|
||||
[⊃⃒] => &nsupset
|
||||
[⫆̸] => &nsupseteqq
|
||||
[⊃⃒] => ⊃⃒
|
||||
[⫆̸] => ⫆̸
|
||||
[ñ] => ñ
|
||||
[≸] => ≸
|
||||
[⋫] => ⋫
|
||||
@@ -1133,18 +1133,18 @@ Array
|
||||
[ ] =>  
|
||||
[⊭] => ⊭
|
||||
[⤄] => ⤄
|
||||
[≍⃒] => &nvap
|
||||
[≍⃒] => ≍⃒
|
||||
[⊬] => ⊬
|
||||
[≥⃒] => &nvge
|
||||
[>⃒] => &nvgt
|
||||
[≥⃒] => ≥⃒
|
||||
[>⃒] => >⃒
|
||||
[⧞] => ⧞
|
||||
[⤂] => ⤂
|
||||
[≤⃒] => &nvle
|
||||
[<⃒] => &nvlt
|
||||
[⊴⃒] => &nvltrie
|
||||
[≤⃒] => ≤⃒
|
||||
[<⃒] => <⃒
|
||||
[⊴⃒] => ⊴⃒
|
||||
[⤃] => ⤃
|
||||
[⊵⃒] => &nvrtrie
|
||||
[∼⃒] => &nvsim
|
||||
[⊵⃒] => ⊵⃒
|
||||
[∼⃒] => ∼⃒
|
||||
[⇖] => ⇖
|
||||
[⤣] => ⤣
|
||||
[↖] => ↖
|
||||
@@ -1254,7 +1254,7 @@ Array
|
||||
[⇛] => ⇛
|
||||
[⤜] => ⤜
|
||||
[⥤] => ⥤
|
||||
[∽̱] => &race
|
||||
[∽̱] => ∽̱
|
||||
[ŕ] => ŕ
|
||||
[⦳] => ⦳
|
||||
[⦒] => ⦒
|
||||
@@ -1364,7 +1364,7 @@ Array
|
||||
[⌣] => ⌣
|
||||
[⪪] => ⪪
|
||||
[⪬] => ⪬
|
||||
[⪬︀] => &smtes
|
||||
[⪬︀] => ⪬︀
|
||||
[ь] => ь
|
||||
[/] => /
|
||||
[⧄] => ⧄
|
||||
@@ -1372,9 +1372,9 @@ Array
|
||||
[𝕤] => 𝕤
|
||||
[♠] => ♠
|
||||
[⊓] => ⊓
|
||||
[⊓︀] => &sqcaps
|
||||
[⊓︀] => ⊓︀
|
||||
[⊔] => ⊔
|
||||
[⊔︀] => &sqcups
|
||||
[⊔︀] => ⊔︀
|
||||
[⊏] => ⊏
|
||||
[⊐] => ⊐
|
||||
[▪] => ▪
|
||||
@@ -1501,7 +1501,7 @@ Array
|
||||
[⫩] => ⫩
|
||||
[⦜] => ⦜
|
||||
[ϰ] => ϰ
|
||||
[⫌︀] => &varsupsetneqq
|
||||
[⫌︀] => ⫌︀
|
||||
[⊲] => ⊲
|
||||
[в] => в
|
||||
[⊢] => ⊢
|
||||
@@ -1510,13 +1510,13 @@ Array
|
||||
[⋮] => ⋮
|
||||
[|] => |
|
||||
[𝔳] => 𝔳
|
||||
[⊂⃒] => &vnsub
|
||||
[⊂⃒] => ⊂⃒
|
||||
[𝕧] => 𝕧
|
||||
[⊳] => ⊳
|
||||
[𝓋] => 𝓋
|
||||
[⫋︀] => &vsubnE
|
||||
[⊊︀] => &vsubne
|
||||
[⊋︀] => &vsupne
|
||||
[⫋︀] => ⫋︀
|
||||
[⊊︀] => ⊊︀
|
||||
[⊋︀] => ⊋︀
|
||||
[⦚] => ⦚
|
||||
[ŵ] => ŵ
|
||||
[⩟] => ⩟
|
||||
|
||||
@@ -81,7 +81,7 @@ Array
|
||||
[^] => ^
|
||||
[_] => _
|
||||
[`] => `
|
||||
[fj] => &fjlig
|
||||
[fj] => fj
|
||||
[{] => {
|
||||
[|] => |
|
||||
[}] => }
|
||||
|
||||
@@ -352,6 +352,7 @@ static int check_http_host(char *target)
|
||||
char *colon;
|
||||
|
||||
if ((tmp = zend_hash_str_find(&EG(symbol_table), ZEND_STRL("_SERVER"))) &&
|
||||
Z_TYPE_P(tmp) == IS_ARRAY &&
|
||||
(host = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("HTTP_HOST"))) &&
|
||||
Z_TYPE_P(host) == IS_STRING) {
|
||||
host_tmp = zend_string_init(Z_STRVAL_P(host), Z_STRLEN_P(host), 0);
|
||||
@@ -519,7 +520,7 @@ state_plain_begin:
|
||||
state_plain:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 523 "ext/standard/url_scanner_ex.c"
|
||||
#line 524 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -569,22 +570,22 @@ yy2:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy2;
|
||||
}
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain; }
|
||||
#line 575 "ext/standard/url_scanner_ex.c"
|
||||
#line 576 "ext/standard/url_scanner_ex.c"
|
||||
yy5:
|
||||
++YYCURSOR;
|
||||
#line 525 "ext/standard/url_scanner_ex.re"
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
|
||||
#line 580 "ext/standard/url_scanner_ex.c"
|
||||
#line 581 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
#line 528 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_tag:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 588 "ext/standard/url_scanner_ex.c"
|
||||
#line 589 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -627,9 +628,9 @@ state_tag:
|
||||
goto yy11;
|
||||
}
|
||||
++YYCURSOR;
|
||||
#line 533 "ext/standard/url_scanner_ex.re"
|
||||
#line 534 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 633 "ext/standard/url_scanner_ex.c"
|
||||
#line 634 "ext/standard/url_scanner_ex.c"
|
||||
yy11:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -637,11 +638,11 @@ yy11:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy11;
|
||||
}
|
||||
#line 532 "ext/standard/url_scanner_ex.re"
|
||||
#line 533 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
|
||||
#line 643 "ext/standard/url_scanner_ex.c"
|
||||
#line 644 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 534 "ext/standard/url_scanner_ex.re"
|
||||
#line 535 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_next_arg_begin:
|
||||
@@ -650,7 +651,7 @@ state_next_arg_begin:
|
||||
state_next_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 654 "ext/standard/url_scanner_ex.c"
|
||||
#line 655 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -706,9 +707,9 @@ state_next_arg:
|
||||
yy16:
|
||||
++YYCURSOR;
|
||||
yy17:
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 712 "ext/standard/url_scanner_ex.c"
|
||||
#line 713 "ext/standard/url_scanner_ex.c"
|
||||
yy18:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -716,30 +717,30 @@ yy18:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy18;
|
||||
}
|
||||
#line 543 "ext/standard/url_scanner_ex.re"
|
||||
#line 544 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg; }
|
||||
#line 722 "ext/standard/url_scanner_ex.c"
|
||||
#line 723 "ext/standard/url_scanner_ex.c"
|
||||
yy21:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '>') goto yy17;
|
||||
yy22:
|
||||
++YYCURSOR;
|
||||
#line 542 "ext/standard/url_scanner_ex.re"
|
||||
#line 543 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
|
||||
#line 730 "ext/standard/url_scanner_ex.c"
|
||||
#line 731 "ext/standard/url_scanner_ex.c"
|
||||
yy24:
|
||||
++YYCURSOR;
|
||||
#line 544 "ext/standard/url_scanner_ex.re"
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
|
||||
#line 735 "ext/standard/url_scanner_ex.c"
|
||||
#line 736 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
#line 547 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 743 "ext/standard/url_scanner_ex.c"
|
||||
#line 744 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -784,9 +785,9 @@ state_arg:
|
||||
if (yych <= 'z') goto yy30;
|
||||
yy28:
|
||||
++YYCURSOR;
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
|
||||
#line 790 "ext/standard/url_scanner_ex.c"
|
||||
#line 791 "ext/standard/url_scanner_ex.c"
|
||||
yy30:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -794,17 +795,17 @@ yy30:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy30;
|
||||
}
|
||||
#line 551 "ext/standard/url_scanner_ex.re"
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
|
||||
#line 800 "ext/standard/url_scanner_ex.c"
|
||||
#line 801 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
#line 554 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_before_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 808 "ext/standard/url_scanner_ex.c"
|
||||
#line 809 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -847,9 +848,9 @@ state_before_val:
|
||||
if (yych == '=') goto yy38;
|
||||
++YYCURSOR;
|
||||
yy36:
|
||||
#line 559 "ext/standard/url_scanner_ex.re"
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; goto state_next_arg_begin; }
|
||||
#line 853 "ext/standard/url_scanner_ex.c"
|
||||
#line 854 "ext/standard/url_scanner_ex.c"
|
||||
yy37:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ' ') goto yy41;
|
||||
@@ -861,9 +862,9 @@ yy38:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy38;
|
||||
}
|
||||
#line 558 "ext/standard/url_scanner_ex.re"
|
||||
#line 559 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
|
||||
#line 867 "ext/standard/url_scanner_ex.c"
|
||||
#line 868 "ext/standard/url_scanner_ex.c"
|
||||
yy41:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -873,14 +874,14 @@ yy41:
|
||||
YYCURSOR = YYMARKER;
|
||||
goto yy36;
|
||||
}
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
#line 561 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
|
||||
state_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 884 "ext/standard/url_scanner_ex.c"
|
||||
#line 885 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -933,15 +934,15 @@ yy46:
|
||||
if (yybm[0+yych] & 32) {
|
||||
goto yy46;
|
||||
}
|
||||
#line 568 "ext/standard/url_scanner_ex.re"
|
||||
#line 569 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
|
||||
#line 939 "ext/standard/url_scanner_ex.c"
|
||||
#line 940 "ext/standard/url_scanner_ex.c"
|
||||
yy49:
|
||||
++YYCURSOR;
|
||||
yy50:
|
||||
#line 569 "ext/standard/url_scanner_ex.re"
|
||||
#line 570 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg_begin; }
|
||||
#line 945 "ext/standard/url_scanner_ex.c"
|
||||
#line 946 "ext/standard/url_scanner_ex.c"
|
||||
yy51:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == '>') goto yy50;
|
||||
@@ -964,9 +965,9 @@ yy55:
|
||||
goto yy50;
|
||||
yy56:
|
||||
++YYCURSOR;
|
||||
#line 566 "ext/standard/url_scanner_ex.re"
|
||||
#line 567 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
|
||||
#line 970 "ext/standard/url_scanner_ex.c"
|
||||
#line 971 "ext/standard/url_scanner_ex.c"
|
||||
yy58:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -977,11 +978,11 @@ yy59:
|
||||
}
|
||||
if (yych >= '(') goto yy55;
|
||||
++YYCURSOR;
|
||||
#line 567 "ext/standard/url_scanner_ex.re"
|
||||
#line 568 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
|
||||
#line 983 "ext/standard/url_scanner_ex.c"
|
||||
#line 984 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 570 "ext/standard/url_scanner_ex.re"
|
||||
#line 571 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
stop:
|
||||
|
||||
@@ -355,6 +355,7 @@ static int check_http_host(char *target)
|
||||
char *colon;
|
||||
|
||||
if ((tmp = zend_hash_str_find(&EG(symbol_table), ZEND_STRL("_SERVER"))) &&
|
||||
Z_TYPE_P(tmp) == IS_ARRAY &&
|
||||
(host = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("HTTP_HOST"))) &&
|
||||
Z_TYPE_P(host) == IS_STRING) {
|
||||
host_tmp = zend_string_init(Z_STRVAL_P(host), Z_STRLEN_P(host), 0);
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@ ARG_ENABLE("zip", "ZIP support", "yes");
|
||||
if (PHP_ZIP != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("zip.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\include;" + PHP_EXTRA_INCLUDES) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("zipconf.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\lib\\libzip\\include;" + PHP_EXTRA_LIBS + "\\libzip\\include;" + PHP_ZIP) &&
|
||||
(PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP))
|
||||
(PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP) && CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP))
|
||||
) {
|
||||
EXTENSION('zip', 'php_zip.c zip_stream.c');
|
||||
|
||||
if (get_define("LIBS_ZIP").match("libzip_a.lib")) {
|
||||
if (get_define("LIBS_ZIP").match("libzip_a(?:_debug)?\.lib")) {
|
||||
/* Using static dependency lib. */
|
||||
AC_DEFINE("ZIP_STATIC", 1);
|
||||
}
|
||||
|
||||
+5
-2
@@ -1026,10 +1026,13 @@ static void php_zip_object_free_storage(zend_object *object) /* {{{ */
|
||||
}
|
||||
if (intern->za) {
|
||||
if (zip_close(intern->za) != 0) {
|
||||
#if LIBZIP_VERSION_MAJOR == 1 && LIBZIP_VERSION_MINOR == 3 && LIBZIP_VERSION_MICRO == 1
|
||||
php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", "zip_close have failed");
|
||||
#else
|
||||
php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context: %s", zip_strerror(intern->za));
|
||||
return;
|
||||
zip_discard(intern->za);
|
||||
#endif
|
||||
}
|
||||
intern->za = NULL;
|
||||
}
|
||||
|
||||
if (intern->buffers_cnt>0) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
ZipArchive Bug #76524 (memory leak with ZipArchive::OVERWRITE flag and empty archive)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('zip')) die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = 0;
|
||||
do {
|
||||
$filename = __DIR__ . "/nonexistent" . ($i++) . ".zip";
|
||||
} while (file_exists($filename));
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
echo 'ok';
|
||||
|
||||
/* Zip-related error messages depend on platform and libzip version,
|
||||
so the regex is used to check that Zend MM does NOT show warnings
|
||||
about leaks: */
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
ok((?!memory leaks detected).)*
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
/* edit configure.ac to change version number */
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 2
|
||||
#define PHP_RELEASE_VERSION 7
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.2.7-dev"
|
||||
#define PHP_VERSION_ID 70207
|
||||
#define PHP_RELEASE_VERSION 9
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "7.2.9"
|
||||
#define PHP_VERSION_ID 70209
|
||||
+1
-1
@@ -311,7 +311,7 @@ PW32IO int php_win32_ioutil_mkdir(const char *path, mode_t mode)
|
||||
int ret = 0;
|
||||
DWORD err = 0;
|
||||
|
||||
if (pathw_len < _MAX_PATH && pathw_len > _MAX_PATH - 12) {
|
||||
if (pathw_len < _MAX_PATH && pathw_len >= _MAX_PATH - 12) {
|
||||
/* Special case here. From the doc:
|
||||
|
||||
"When using an API to create a directory, the specified path cannot be
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ typedef enum {
|
||||
#define PHP_WIN32_IOUTIL_IS_JUNCTION_PATHW(pathw, path_lenw) (path_lenw >= PHP_WIN32_IOUTIL_JUNCTION_PREFIX_LENW \
|
||||
&& 0 == wcsncmp((pathw), PHP_WIN32_IOUTIL_JUNCTION_PREFIXW, PHP_WIN32_IOUTIL_JUNCTION_PREFIX_LENW))
|
||||
#define PHP_WIN32_IOUTIL_IS_ABSOLUTEW(pathw, path_lenw) (PHP_WIN32_IOUTIL_IS_LONG_PATHW(pathw, path_lenw) \
|
||||
|| path_lenw >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(pathw[0]) && L':' == pathw[1] && IS_SLASHW(pathw[2]))
|
||||
|| path_lenw >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(pathw[0]) && L':' == pathw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[2]))
|
||||
#define PHP_WIN32_IOUTIL_IS_UNC(pathw, path_lenw) (path_lenw >= 2 && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[0]) && PHP_WIN32_IOUTIL_IS_SLASHW(pathw[1]) \
|
||||
|| path_lenw >= PHP_WIN32_IOUTIL_UNC_PATH_PREFIX_LENW && 0 == wcsncmp((pathw), PHP_WIN32_IOUTIL_UNC_PATH_PREFIXW, PHP_WIN32_IOUTIL_UNC_PATH_PREFIX_LENW))
|
||||
|
||||
|
||||
+38
-9
@@ -29,9 +29,9 @@ DIR *opendir(const char *dir)
|
||||
DIR *dp;
|
||||
wchar_t *filespecw, *resolvedw;
|
||||
HANDLE handle;
|
||||
int index;
|
||||
char resolved_path_buff[MAXPATHLEN];
|
||||
size_t resolvedw_len, filespecw_len;
|
||||
size_t resolvedw_len, filespecw_len, index;
|
||||
zend_bool might_need_prefix;
|
||||
|
||||
if (!VCWD_REALPATH(dir, resolved_path_buff)) {
|
||||
return NULL;
|
||||
@@ -48,7 +48,12 @@ DIR *opendir(const char *dir)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
might_need_prefix = resolvedw_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(resolvedw[0]) && L':' == resolvedw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(resolvedw[2]);
|
||||
|
||||
filespecw_len = resolvedw_len + 2;
|
||||
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
|
||||
filespecw_len += PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW;
|
||||
}
|
||||
filespecw = (wchar_t *)malloc((filespecw_len + 1)*sizeof(wchar_t));
|
||||
if (filespecw == NULL) {
|
||||
free(dp);
|
||||
@@ -56,8 +61,14 @@ DIR *opendir(const char *dir)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wcscpy(filespecw, resolvedw);
|
||||
index = (int)filespecw_len - 1;
|
||||
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
|
||||
wcscpy(filespecw, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW);
|
||||
wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, resolvedw);
|
||||
index = resolvedw_len + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW - 1;
|
||||
} else {
|
||||
wcscpy(filespecw, resolvedw);
|
||||
index = resolvedw_len - 1;
|
||||
}
|
||||
if (index >= 0 && filespecw[index] == L'/' || index == 0 && filespecw[index] == L'\\')
|
||||
filespecw[index] = L'\0';
|
||||
wcscat(filespecw, L"\\*");
|
||||
@@ -178,24 +189,42 @@ int rewinddir(DIR *dp)
|
||||
/* Re-set to the beginning */
|
||||
wchar_t *filespecw;
|
||||
HANDLE handle;
|
||||
int index;
|
||||
size_t dirw_len, filespecw_len, index;
|
||||
zend_bool might_need_prefix;
|
||||
|
||||
FindClose(dp->handle);
|
||||
|
||||
dp->offset = 0;
|
||||
dp->finished = 0;
|
||||
|
||||
filespecw = (wchar_t *)malloc((wcslen((wchar_t *)dp->dirw) + 2 + 1)*sizeof(wchar_t));
|
||||
/* XXX save the dir len into the struct. */
|
||||
dirw_len = wcslen((wchar_t *)dp->dirw);
|
||||
|
||||
might_need_prefix = dirw_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(dp->dirw[0]) && L':' == dp->dirw[1] && PHP_WIN32_IOUTIL_IS_SLASHW(dp->dirw[2]);
|
||||
|
||||
filespecw_len = dirw_len + 2;
|
||||
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
|
||||
filespecw_len += PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW;
|
||||
}
|
||||
|
||||
filespecw = (wchar_t *)malloc((filespecw_len + 1)*sizeof(wchar_t));
|
||||
if (filespecw == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
wcscpy(filespecw, (wchar_t *)dp->dirw);
|
||||
index = (int)wcslen(filespecw) - 1;
|
||||
if (filespecw_len >= _MAX_PATH && might_need_prefix) {
|
||||
wcscpy(filespecw, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW);
|
||||
wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, dp->dirw);
|
||||
index = dirw_len + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW - 1;
|
||||
} else {
|
||||
wcscpy(filespecw, dp->dirw);
|
||||
index = dirw_len - 1;
|
||||
}
|
||||
|
||||
if (index >= 0 && (filespecw[index] == L'/' ||
|
||||
(filespecw[index] == L'\\' && index == 0)))
|
||||
filespecw[index] = L'\0';
|
||||
wcscat(filespecw, L"/*");
|
||||
wcscat(filespecw, L"\\*");
|
||||
|
||||
if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH)) == INVALID_HANDLE_VALUE) {
|
||||
dp->finished = 1;
|
||||
|
||||
+5
-3
@@ -66,7 +66,7 @@ void closelog(void)
|
||||
PW32G(log_source) = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
if (PW32G(log_header)) {
|
||||
efree(PW32G(log_header));
|
||||
free(PW32G(log_header));
|
||||
PW32G(log_header) = NULL;
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,6 @@ void syslog(int priority, const char *message, ...)
|
||||
efree(tmp);
|
||||
}
|
||||
|
||||
|
||||
/* Emulator for BSD openlog() routine
|
||||
* Accepts: identity
|
||||
* options
|
||||
@@ -121,11 +120,14 @@ void syslog(int priority, const char *message, ...)
|
||||
|
||||
void openlog(const char *ident, int logopt, int facility)
|
||||
{
|
||||
size_t header_len;
|
||||
|
||||
closelog();
|
||||
|
||||
PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION);
|
||||
spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
|
||||
header_len = strlen(ident) + 2 + 11;
|
||||
PW32G(log_header) = malloc(header_len*sizeof(char));
|
||||
sprintf_s(PW32G(log_header), header_len, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user