mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-15 21:16:38 +00:00
Compare commits
246
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
645f1b4761 | ||
|
|
72d534e791 | ||
|
|
3bc1226804 | ||
|
|
0f3e01f5cc | ||
|
|
49501f8f41 | ||
|
|
3af6201224 | ||
|
|
6275825c68 | ||
|
|
4f8e703854 | ||
|
|
d8c80af71e | ||
|
|
e112d71435 | ||
|
|
2def85688d | ||
|
|
259477826c | ||
|
|
1f3b87dc11 | ||
|
|
ab07265573 | ||
|
|
bd0b0cc8c9 | ||
|
|
71fd58652f | ||
|
|
73d84d4bbd | ||
|
|
4d936c1254 | ||
|
|
f555224743 | ||
|
|
3069ad8dd1 | ||
|
|
207105b1a3 | ||
|
|
f64be0b013 | ||
|
|
de5a5f6fdc | ||
|
|
472b25921e | ||
|
|
4fb7665c09 | ||
|
|
1a23ebc1ff | ||
|
|
e88ab74886 | ||
|
|
b59718bdc4 | ||
|
|
46ecda76ba | ||
|
|
307acb6618 | ||
|
|
b06f8cb58b | ||
|
|
42608a3401 | ||
|
|
afb20f4895 | ||
|
|
315d3910fa | ||
|
|
075986f214 | ||
|
|
86aa1ca990 | ||
|
|
618dcd6520 | ||
|
|
9ebf813ea4 | ||
|
|
4c9fe5a490 | ||
|
|
da966a93ac | ||
|
|
d058e30917 | ||
|
|
aee20e637a | ||
|
|
159e5c1048 | ||
|
|
21c6ba3412 | ||
|
|
9689796c10 | ||
|
|
54e2224df7 | ||
|
|
3e5b8c1e89 | ||
|
|
9ba2cfd33e | ||
|
|
4988e83fe9 | ||
|
|
c2b8066efb | ||
|
|
9871555090 | ||
|
|
9ca1b2a775 | ||
|
|
63607375f5 | ||
|
|
2cc1cbf2f4 | ||
|
|
15abb2b56e | ||
|
|
e78712791d | ||
|
|
1fdc518971 | ||
|
|
b112d09013 | ||
|
|
5f030924c1 | ||
|
|
666cb6c802 | ||
|
|
9c6262f39b | ||
|
|
b2934d2612 | ||
|
|
f0d40286e7 | ||
|
|
cd06b5af09 | ||
|
|
0c0cbb43da | ||
|
|
64e6ddc7f7 | ||
|
|
d9d152b895 | ||
|
|
a8e25fdbf8 | ||
|
|
eab66f9068 | ||
|
|
2d6d1ec55b | ||
|
|
2d96fdd54f | ||
|
|
82e4ad3983 | ||
|
|
74a696d53b | ||
|
|
f213ee5952 | ||
|
|
4d6f808c16 | ||
|
|
c48c638aeb | ||
|
|
e3d25e78eb | ||
|
|
55e7459cea | ||
|
|
b01336814d | ||
|
|
b62fb3aa0c | ||
|
|
34e5d3a87d | ||
|
|
0ddda0dcb7 | ||
|
|
9fcfe52d03 | ||
|
|
efb1be547c | ||
|
|
84a18c4782 | ||
|
|
e36c04ef48 | ||
|
|
80f4297c25 | ||
|
|
c7aa8ba0ee | ||
|
|
4cde48bb73 | ||
|
|
3f9e8e6686 | ||
|
|
3306b3aa60 | ||
|
|
eaf5c7cdd4 | ||
|
|
bd00fe81cc | ||
|
|
bb9ea4e88b | ||
|
|
6b1fbafdf0 | ||
|
|
747f5b23ae | ||
|
|
46a6ae0d45 | ||
|
|
de65a2243f | ||
|
|
3df47c12f7 | ||
|
|
238f837cbc | ||
|
|
3fd7d819b8 | ||
|
|
78ad5e8864 | ||
|
|
69b48f83df | ||
|
|
dbc2ffba82 | ||
|
|
bedd881da6 | ||
|
|
cdf9178c43 | ||
|
|
b44484b912 | ||
|
|
924ff6164e | ||
|
|
2dc81d4a09 | ||
|
|
a769d873f8 | ||
|
|
e2b61eccb9 | ||
|
|
6918a68d9d | ||
|
|
5816ce330c | ||
|
|
23c124ec75 | ||
|
|
642fb44d69 | ||
|
|
c4e11c8ef3 | ||
|
|
f116a88592 | ||
|
|
418da85f15 | ||
|
|
a4e3589966 | ||
|
|
775b4b54d8 | ||
|
|
1229b0f8cb | ||
|
|
c562d44321 | ||
|
|
c068818ff3 | ||
|
|
e0c0007bd2 | ||
|
|
ad12da4908 | ||
|
|
134e713be2 | ||
|
|
bad5d0d6c5 | ||
|
|
4cb1151fff | ||
|
|
e405ff59f9 | ||
|
|
69ec51eb02 | ||
|
|
a8f98fc7f7 | ||
|
|
08177312fb | ||
|
|
256ec5bebb | ||
|
|
3a7b0027f3 | ||
|
|
4b3ed311aa | ||
|
|
9b3c26d4f4 | ||
|
|
e2b240c164 | ||
|
|
84926a0d71 | ||
|
|
95d2908814 | ||
|
|
fa33b065ac | ||
|
|
ce06677069 | ||
|
|
7c21535fb3 | ||
|
|
ecad9a470f | ||
|
|
8ef5a50e2d | ||
|
|
f67a3cc9bd | ||
|
|
a9e8239f45 | ||
|
|
c9fd093127 | ||
|
|
2b36f3d71f | ||
|
|
2cca43b3ab | ||
|
|
4252f14299 | ||
|
|
e5beb4e828 | ||
|
|
8e7c99acf4 | ||
|
|
afc22828ea | ||
|
|
4e9158da76 | ||
|
|
51cdd3dc50 | ||
|
|
6c32d271d2 | ||
|
|
f4323248ec | ||
|
|
657609ebae | ||
|
|
0da10134f2 | ||
|
|
735468a0b8 | ||
|
|
649027b963 | ||
|
|
65d5e025a7 | ||
|
|
4ef9f536ba | ||
|
|
e0282c3b58 | ||
|
|
4d08b9dac0 | ||
|
|
2e82ed9b73 | ||
|
|
0db20a7cb1 | ||
|
|
6cd140fdf8 | ||
|
|
0b5683e480 | ||
|
|
5d15fdc4a4 | ||
|
|
3b60af90fd | ||
|
|
c1504b81d3 | ||
|
|
91aad4bc81 | ||
|
|
2f606dc5e8 | ||
|
|
8b04e89ef0 | ||
|
|
04cc2f6473 | ||
|
|
82acb58d8a | ||
|
|
3da01a9652 | ||
|
|
3bcab31749 | ||
|
|
be531ce9f0 | ||
|
|
b47cff48de | ||
|
|
7360e6a36f | ||
|
|
a797421e98 | ||
|
|
fd08eaa8bc | ||
|
|
de32c9efc8 | ||
|
|
2689917b17 | ||
|
|
ccd0ff3ac4 | ||
|
|
5cf54f6073 | ||
|
|
7938b9ccac | ||
|
|
e89476a870 | ||
|
|
62700f76cb | ||
|
|
02cc492015 | ||
|
|
b5338c0b7d | ||
|
|
b38de96733 | ||
|
|
0fdceb6cd5 | ||
|
|
0d3e6f6add | ||
|
|
5c96a255ea | ||
|
|
5ca02ca494 | ||
|
|
18eb78854c | ||
|
|
700803b70c | ||
|
|
739ecf5430 | ||
|
|
1af5ca0746 | ||
|
|
2928feca46 | ||
|
|
fb140d582c | ||
|
|
af07b76ccf | ||
|
|
390f64701d | ||
|
|
7991a88675 | ||
|
|
489f3a3234 | ||
|
|
aa3fceeaad | ||
|
|
1e3b960ab5 | ||
|
|
8b1559b9f4 | ||
|
|
55b880070c | ||
|
|
703be4f77e | ||
|
|
27a743b82b | ||
|
|
bdf7393ddb | ||
|
|
2693e52113 | ||
|
|
4e68b2c52b | ||
|
|
0ba04f7737 | ||
|
|
54840f9c8f | ||
|
|
f269cdcd4f | ||
|
|
f76a6cd023 | ||
|
|
6b18d956de | ||
|
|
e46d589624 | ||
|
|
0496f5407f | ||
|
|
3a25a56a92 | ||
|
|
0525574913 | ||
|
|
73cabfedf5 | ||
|
|
12107d619b | ||
|
|
f7f4fd4706 | ||
|
|
e8b7698f5e | ||
|
|
2aae60461c | ||
|
|
f8c514ba6b | ||
|
|
8dc4f4dc9e | ||
|
|
5f8380d33e | ||
|
|
89637c6b41 | ||
|
|
1fa8e74d6e | ||
|
|
4b38feabe7 | ||
|
|
41ba98f02d | ||
|
|
a29264eb8c | ||
|
|
396c0f7a76 | ||
|
|
4903f044d3 | ||
|
|
6f78923d1f | ||
|
|
04904333fd | ||
|
|
ce64b82ebb | ||
|
|
3eecee16d1 | ||
|
|
0f8cf3b849 |
No files matched your search
+1
-1
@@ -24,7 +24,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.0.5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.9
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -1,6 +1,80 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017, PHP 7.1.8
|
||||
31 Aug 2017, PHP 7.1.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
|
||||
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
|
||||
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
|
||||
. Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
|
||||
(cebe)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
|
||||
(cmb)
|
||||
. Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
|
||||
(Nikita)
|
||||
. Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
|
||||
an abstract class). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Expose oci_unregister_taf_callback() (Tianfang Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74980 (Narrowing occurred during type inference). (Laruence)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
|
||||
(bwbroersma)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
. Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
|
||||
(Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #75049 (spl_autoload_unregister can't handle
|
||||
spl_autoload_functions results). (Laruence)
|
||||
. Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
|
||||
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
|
||||
(Andrew Nester)
|
||||
. Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
|
||||
. Fixed bug #74103 (heap-use-after-free when unserializing invalid array
|
||||
size). (Nikita)
|
||||
. Fixed bug #75054 (A Denial of Service Vulnerability was found when
|
||||
performing deserialization). (Nikita)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
|
||||
properties). (blar)
|
||||
|
||||
03 Aug 2017, PHP 7.1.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74832 (Loading PHP extension with already registered function
|
||||
@@ -9,6 +83,16 @@ PHP NEWS
|
||||
(jhdxr)
|
||||
. Fixed bug #74761 (Unary operator expected error on some systems). (petk)
|
||||
. Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic)
|
||||
. Fixed bug #74923 (Crash when crawling through network share). (Anatol)
|
||||
. Fixed bug #74913 (fixed incorrect poll.h include). (petk)
|
||||
. Fixed bug #74906 (fixed incorrect errno.h include). (petk)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
|
||||
property). (jhdxr)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74623 (Infinite loop in type inference when using HTMLPurifier).
|
||||
@@ -28,6 +112,10 @@ PHP NEWS
|
||||
- SPL:
|
||||
. Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #74883 (SQLite3::__construct() produces "out of memory" exception
|
||||
with invalid flags). (Anatol)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #73173 (huge memleak when wddx_unserialize).
|
||||
(tloi at fortinet dot com)
|
||||
@@ -35,8 +123,6 @@ PHP NEWS
|
||||
- zlib:
|
||||
. Fixed bug #73944 (dictionary option of inflate_init() does not work).
|
||||
(wapmorgan)
|
||||
. Expose inflate_get_status() and inflate_get_read_len() functions.
|
||||
(Matthew Trescott)
|
||||
|
||||
06 Jul 2017, PHP 7.1.7
|
||||
|
||||
@@ -46,6 +132,14 @@ PHP NEWS
|
||||
. Fixed bug #74658 (Undefined constants in array properties result in broken
|
||||
properties). (Laruence)
|
||||
. Fixed misparsing of abstract unix domain socket names. (Sara)
|
||||
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
|
||||
(Stas)
|
||||
. Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
|
||||
zval_get_type). (Nikita)
|
||||
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
|
||||
unserialize). (Nikita)
|
||||
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
|
||||
@@ -54,6 +148,9 @@ PHP NEWS
|
||||
- DOM:
|
||||
. Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
|
||||
. Fixed bug #74705 (Wrong reflection on Collator::getSortKey and
|
||||
@@ -65,7 +162,6 @@ PHP NEWS
|
||||
|
||||
- OCI8:
|
||||
. Add TAF callback (PR #2459). (KoenigsKind)
|
||||
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74663 (Segfault with opcache.memory_protect and
|
||||
@@ -75,6 +171,8 @@ PHP NEWS
|
||||
- OpenSSL:
|
||||
. Fixed bug #74720 (pkcs7_en/decrypt does not work if \x1a is used in
|
||||
content). (Anatol)
|
||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||
(Stas)
|
||||
|
||||
- PDO_OCI:
|
||||
. Support Instant Client 12.2 in --with-pdo-oci configure option.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0=0&~2000000000
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "0"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #74947 (Segfault in scanner on INF number)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
INF-INF
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Bug #74954 (crash after update of generator yielding from finished generator)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from() {
|
||||
yield 1;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function gen($gen) {
|
||||
try {
|
||||
var_dump(yield from $gen);
|
||||
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
|
||||
}
|
||||
|
||||
$gen = from();
|
||||
$gens[] = gen($gen);
|
||||
$gens[] = gen($gen);
|
||||
|
||||
foreach ($gens as $g) {
|
||||
$g->current();
|
||||
}
|
||||
|
||||
do {
|
||||
foreach ($gens as $i => $g) {
|
||||
$g->next();
|
||||
}
|
||||
} while($gens[0]->valid());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Caught exception!
|
||||
Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): from()
|
||||
#1 [internal function]: gen(Object(Generator))
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->next()
|
||||
#2 {main}
|
||||
+5
-1
@@ -660,6 +660,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
extern zend_php_scanner_globals language_scanner_globals;
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_cp_set_by_id(65001);
|
||||
#endif
|
||||
|
||||
start_memory_manager();
|
||||
|
||||
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
|
||||
@@ -712,7 +716,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
#endif /* HAVE_SYS_SDT_H */
|
||||
#endif /* HAVE_DTRACE */
|
||||
zend_compile_string = compile_string;
|
||||
zend_throw_exception_hook = NULL;
|
||||
|
||||
|
||||
@@ -757,15 +757,13 @@ failure:
|
||||
|
||||
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
|
||||
{
|
||||
zend_generator *generator;
|
||||
zend_generator *generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
/* The generator is already closed, thus can't resume */
|
||||
if (UNEXPECTED(!orig_generator->execute_data)) {
|
||||
if (UNEXPECTED(!generator->execute_data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
try_again:
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
zend_throw_error(NULL, "Cannot resume an already running generator");
|
||||
|
||||
@@ -55,7 +55,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int i_result;
|
||||
int i_op1, i_op2;
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG];
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
|
||||
+194
-196
File diff suppressed because it is too large.
Load diff
@@ -1663,7 +1663,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (errno == ERANGE) { /* Overflow */
|
||||
errno = 0;
|
||||
if (yytext[0] == '0') { /* octal overflow */
|
||||
errno = 0;
|
||||
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, (const char **)&end));
|
||||
} else {
|
||||
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, (const char **)&end));
|
||||
@@ -1675,7 +1674,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
ZVAL_UNDEF(zendlval);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
ZEND_ASSERT(!errno);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
/* Also not an assert for the same reason */
|
||||
|
||||
@@ -433,7 +433,7 @@ char *alloca();
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str))
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
((n) ? (((n)<0) ? -1 : 1) : 0)
|
||||
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
|
||||
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ typedef unsigned long int uint32_t;
|
||||
#define NO_INFNAN_CHECK
|
||||
#endif
|
||||
|
||||
#ifndef NO_ERRNO
|
||||
#define NO_ERRNO
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define IEEE_BIG_ENDIAN 1
|
||||
#else
|
||||
|
||||
+13
-4
@@ -445,11 +445,15 @@ static void cwd_globals_dtor(virtual_cwd_globals *cwd_g) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
if (reinit) {
|
||||
free(main_cwd_state.cwd);
|
||||
}
|
||||
|
||||
#ifdef NETWARE
|
||||
result = getcwdpath(cwd, NULL, 1);
|
||||
if(result)
|
||||
@@ -461,10 +465,10 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
++c;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#ifdef ZEND_WIN32
|
||||
#elif defined(ZEND_WIN32)
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = php_win32_ioutil_getcwd(cwd, sizeof(cwd));
|
||||
#else
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
@@ -478,7 +482,12 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
}
|
||||
#endif
|
||||
main_cwd_state.cwd = strdup(cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
{
|
||||
virtual_cwd_main_cwd_init(0);
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
|
||||
#else
|
||||
|
||||
@@ -251,6 +251,10 @@ CWD_API zend_long realpath_cache_size(void);
|
||||
CWD_API zend_long realpath_cache_max_buckets(void);
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
|
||||
|
||||
#ifdef CWD_EXPORTS
|
||||
extern void virtual_cwd_main_cwd_init(uint8_t);
|
||||
#endif
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
|
||||
+10
-1
@@ -2,6 +2,8 @@
|
||||
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
|
||||
@@ -22,12 +24,19 @@ echo Updating dependencies in %DEPS_DIR%
|
||||
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
rem Something went wrong, most likely when concurrent builds were to fetch deps
|
||||
rem updates. It might be, that some locking mechanism is needed.
|
||||
if not exist "%DEPS_DIR%" (
|
||||
cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
)
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
cmd /c buildconf.bat --force
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
|
||||
|
||||
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba
|
||||
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba,ftp
|
||||
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
|
||||
|
||||
cmd /c configure.bat ^
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=8
|
||||
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`
|
||||
|
||||
|
||||
+19
-3
@@ -17,11 +17,23 @@ if test "$PHP_CURL" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
if which dpkg-architecture>/dev/null; then
|
||||
AC_MSG_CHECKING(for cURL in multiarch path)
|
||||
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
|
||||
CURL_DIR=/usr
|
||||
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the libcurl distribution -
|
||||
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
fi
|
||||
|
||||
@@ -45,7 +57,11 @@ if test "$PHP_CURL" != "no"; then
|
||||
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
if test -z "$CURL_MULTIARCH_INCLUDE"; then
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
else
|
||||
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
|
||||
fi
|
||||
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
||||
|
||||
|
||||
+6181
-7085
File diff suppressed because it is too large.
Load diff
@@ -913,7 +913,7 @@ datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
|
||||
datenoday = monthtext ([ .\t-])* year4;
|
||||
datenodayrev = year4 ([ .\t-])* monthtext;
|
||||
datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year;
|
||||
datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*;
|
||||
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
|
||||
datenoyearrev = day ([ .\t-])* monthtext;
|
||||
datenocolon = year4 monthlz daylz;
|
||||
|
||||
|
||||
+9
-5
@@ -1944,6 +1944,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
|
||||
if (iterator->object->current) {
|
||||
timelib_time_dtor(iterator->object->current);
|
||||
}
|
||||
if (!iterator->object->start) {
|
||||
zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
|
||||
return;
|
||||
}
|
||||
iterator->object->current = timelib_time_clone(iterator->object->start);
|
||||
date_period_it_invalidate_current(iter);
|
||||
}
|
||||
@@ -1998,7 +2002,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
zval *prop;
|
||||
int retval = 0;
|
||||
|
||||
if (Z_TYPE_P(member) != IS_STRING) {
|
||||
if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
@@ -2014,10 +2018,10 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
prop = date_interval_read_property(object, member, type, cache_slot, &rv);
|
||||
|
||||
if (prop != NULL) {
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
} else if (type == 1) {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74852 property_exists returns true on unknown DateInterval property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2D');
|
||||
var_dump(property_exists($interval,'abcde'));
|
||||
var_dump(isset($interval->abcde));
|
||||
var_dump($interval->abcde);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Notice: Undefined property: DateInterval::$abcde in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #75002 Null Pointer Dereference in timelib_time_clone
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class aaa extends DatePeriod {
|
||||
public function __construct() { }
|
||||
}
|
||||
|
||||
$start=new DateTime( '2012-08-01' );
|
||||
|
||||
foreach (new aaa($start) as $y) {
|
||||
$a=$key;
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: DatePeriod has not been initialized correctly in %sbug75002.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug75002.php on line %d
|
||||
@@ -34,14 +34,14 @@ foreach ( $tests as $start => $data )
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Sat, 23 Oct 2010 00:00:00 +0000
|
||||
Fri, 15 Oct 2010 23:00:00 +0000
|
||||
Wed, 15 Dec 2010 16:15:00 +0000
|
||||
Mon, 20 Dec 2010 00:00:00 +0000
|
||||
Mon, 20 Dec 2010 10:00:00 +0000
|
||||
Tue, 21 Dec 2010 12:00:00 +0000
|
||||
Mon, 03 Jan 2011 00:00:00 +0000
|
||||
Mon, 03 Jan 2011 09:00:00 +0000
|
||||
Sat, 23 Oct 2010 00:00:00 +0100
|
||||
Fri, 15 Oct 2010 23:00:00 +0100
|
||||
Sun, 28 Mar 2010 00:15:00 +0000
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Test exif_read_data on unavailable file
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug73115.JPG';
|
||||
exif_read_data($infile);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(): Unable to open file in %sexif_read_data_0.php on line %d
|
||||
===DONE===
|
||||
|
||||
Binary file not shown.
@@ -1,16 +1,38 @@
|
||||
--TEST--
|
||||
Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
|
||||
if (ini_get("default_charset") != "UTF-8") {
|
||||
die("skip require default_charset == UTF-8");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647私はガラスを食べられます.mov";
|
||||
$src = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647.mov";
|
||||
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
|
||||
/* Streams mb path support is tested a lot elsewhere. Copy the existing file
|
||||
therefore, avoid duplication in the repo. */
|
||||
if (!copy($src, $f) || empty(glob($f))) {
|
||||
die("failed to copy '$src' to '$f'");
|
||||
}
|
||||
|
||||
$fi = new finfo(FILEINFO_MIME_TYPE);
|
||||
var_dump($fi->file($f));
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--CLEAN--
|
||||
<?php
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
unlink($f);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(15) "video/quicktime"
|
||||
+++DONE+++
|
||||
|
||||
@@ -147,6 +147,9 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
|
||||
int haveGlobalColormap;
|
||||
gdImagePtr im = 0;
|
||||
|
||||
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
memset(localColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
|
||||
/*1.4//imageNumber = 1; */
|
||||
if (! ReadOK(fd,buf,6)) {
|
||||
return 0;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -1,5 +1,9 @@
|
||||
--TEST--
|
||||
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #74435 (Buffer over-read into uninitialized memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
|
||||
var_dump($im);
|
||||
$width = imagesx($im);
|
||||
$height = imagesy($im);
|
||||
for ($i = 0; $i < $width; $i += 16) {
|
||||
for ($j = 0; $j < $height; $j += 16) {
|
||||
if (($index = imagecolorat($im, $i, $j)) >= 2) {
|
||||
list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
|
||||
if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
|
||||
echo "unexpected color at ($i, $j)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
+25
-25
@@ -173,6 +173,24 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3)
|
||||
ZEND_ARG_INFO(1, position)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 )
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, in_locale)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_ARG_INFO(0, def)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -180,24 +198,6 @@ ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_2_args, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_3_args, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_4_args, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_ARG_INFO(0, arg4)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define intl_0_args collator_static_0_args
|
||||
#define intl_1_arg collator_static_1_arg
|
||||
|
||||
@@ -670,17 +670,17 @@ zend_function_entry intl_functions[] = {
|
||||
PHP_FE( locale_get_script, locale_1_arg )
|
||||
PHP_FE( locale_get_region, locale_1_arg )
|
||||
PHP_FE( locale_get_keywords, locale_1_arg )
|
||||
PHP_FE( locale_get_display_script, locale_2_args )
|
||||
PHP_FE( locale_get_display_region, locale_2_args )
|
||||
PHP_FE( locale_get_display_name, locale_2_args )
|
||||
PHP_FE( locale_get_display_language, locale_2_args)
|
||||
PHP_FE( locale_get_display_variant, locale_2_args )
|
||||
PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args)
|
||||
PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_compose, locale_1_arg )
|
||||
PHP_FE( locale_parse, locale_1_arg )
|
||||
PHP_FE( locale_get_all_variants, locale_1_arg )
|
||||
PHP_FE( locale_filter_matches, locale_3_args )
|
||||
PHP_FE( locale_filter_matches, locale_filter_matches_args )
|
||||
PHP_FE( locale_canonicalize, locale_1_arg )
|
||||
PHP_FE( locale_lookup, locale_4_args )
|
||||
PHP_FE( locale_lookup, locale_lookup_args )
|
||||
PHP_FE( locale_accept_from_http, locale_1_arg )
|
||||
|
||||
/* MessageFormatter functions */
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
--TEST--
|
||||
Bug #74993 Wrong reflection on some locale_* functions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('intl') || print 'skip';
|
||||
--FILE--
|
||||
<?php
|
||||
$funcs = [
|
||||
'locale_get_display_language',
|
||||
'locale_get_display_name',
|
||||
'locale_get_display_region',
|
||||
'locale_get_display_script',
|
||||
'locale_get_display_variant',
|
||||
'locale_filter_matches',
|
||||
'locale_lookup',
|
||||
];
|
||||
|
||||
foreach ($funcs as $func) {
|
||||
echo (new ReflectionFunction($func));
|
||||
}
|
||||
--EXPECT--
|
||||
Function [ <internal:intl> function locale_get_display_language ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_name ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_region ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_script ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_variant ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_filter_matches ] {
|
||||
|
||||
- Parameters [3] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_lookup ] {
|
||||
|
||||
- Parameters [4] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
Parameter #3 [ <optional> $def ]
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ echo $orstr,"\n";
|
||||
echo $new_str,"\n";
|
||||
echo $recovstr,"\n";
|
||||
|
||||
var_dump(($orstr == $recovstr) == $recovstr2);
|
||||
var_dump($orstr === $recovstr);
|
||||
var_dump($orstr === $recovstr2);
|
||||
|
||||
echo "Done.\n";
|
||||
--EXPECT--
|
||||
@@ -29,4 +30,5 @@ echo "Done.\n";
|
||||
ōshanbyū
|
||||
オーシャンビュー
|
||||
bool(true)
|
||||
bool(true)
|
||||
Done.
|
||||
+1
-1
@@ -17,6 +17,6 @@ if (PHP_JSON != "no") {
|
||||
|
||||
ADD_SOURCES(configure_module_dirname, "json_encoder.c json_parser.tab.c json_scanner.c", "json");
|
||||
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h php_json_parser.h php_json_scanner.h");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ const struct mbfl_convert_vtbl vtbl_html_wchar = {
|
||||
mbfl_filt_conv_html_dec_ctor,
|
||||
mbfl_filt_conv_html_dec_dtor,
|
||||
mbfl_filt_conv_html_dec,
|
||||
mbfl_filt_conv_html_dec_flush };
|
||||
mbfl_filt_conv_html_dec_flush,
|
||||
mbfl_filt_conv_html_dec_copy };
|
||||
|
||||
|
||||
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0)
|
||||
@@ -309,4 +310,9 @@ int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest)
|
||||
{
|
||||
*dest = *src;
|
||||
dest->opaque = mbfl_malloc(html_enc_buffer_size+1);
|
||||
memcpy(dest->opaque, src->opaque, html_enc_buffer_size+1);
|
||||
}
|
||||
@@ -42,6 +42,7 @@ int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest);
|
||||
void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter);
|
||||
|
||||
|
||||
@@ -222,11 +222,11 @@ mbfl_filt_tl_jisx0201_jisx0208(int c, mbfl_convert_filter *filt)
|
||||
} else if (mode & (MBFL_FILT_TL_ZEN2HAN_HIRA2KANA
|
||||
| MBFL_FILT_TL_ZEN2HAN_KANA2HIRA)) {
|
||||
if ((mode & MBFL_FILT_TL_ZEN2HAN_HIRA2KANA) &&
|
||||
c >= 0x3041 && c <= 0x3093) {
|
||||
((c >= 0x3041 && c <= 0x3093) || c == 0x309d || c == 0x309e)) {
|
||||
/* Zenkaku hirangana to Zenkaku katakana */
|
||||
s = c + 0x60;
|
||||
} else if ((mode & MBFL_FILT_TL_ZEN2HAN_KANA2HIRA) &&
|
||||
c >= 0x30a1 && c <= 0x30f3) {
|
||||
((c >= 0x30a1 && c <= 0x30f3) || c == 0x30fd || c == 0x30fe)) {
|
||||
/* Zenkaku katakana to Zenkaku hirangana */
|
||||
s = c - 0x60;
|
||||
}
|
||||
|
||||
@@ -457,6 +457,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_eregi_replace, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, pattern)
|
||||
ZEND_ARG_INFO(0, replacement)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
ZEND_ARG_INFO(0, option)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #62934: mb_convert_kana() does not convert iteration marks
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'C', 'UTF-8') . "\n";
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'c', 'UTF-8') . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
アヽスヾメアヽスヾメ
|
||||
あゝすゞめあゝすゞめ
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #71606 (Segmentation fault mb_strcut + mb_list_encodings)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip ext/mbstring not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_strcut('"', 0, 0, 'HTML-ENTITIES');
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
+7
-2
@@ -1149,7 +1149,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
{
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
MYSQL_ROW row;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
MYSQL_FIELD *fields;
|
||||
zend_ulong *field_len;
|
||||
|
||||
@@ -1163,8 +1163,9 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
|
||||
array_init(return_value);
|
||||
field_len = mysql_fetch_lengths(result);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
if (row[i]) {
|
||||
zval res;
|
||||
|
||||
@@ -1244,6 +1245,10 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
||||
php_error_docref(NULL, E_WARNING, "Could not find class '%s'", ZSTR_VAL(class_name));
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
|
||||
zend_throw_error(NULL, "Class '%s' cannot be instantiated", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
fetchtype = MYSQLI_ASSOC;
|
||||
} else {
|
||||
if (override_flags) {
|
||||
|
||||
@@ -1210,7 +1210,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
zval *mysql_result;
|
||||
zval obj;
|
||||
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
|
||||
return;
|
||||
@@ -1219,8 +1219,9 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
const MYSQL_FIELD *field = mysql_fetch_field_direct(result, i);
|
||||
|
||||
object_init(&obj);
|
||||
@@ -1266,7 +1267,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
const size_t *ret;
|
||||
#else
|
||||
@@ -1284,8 +1285,9 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
add_index_long(return_value, i, ret[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysqli = new mysqli("$host:$port", $user, $passwd, $db);
|
||||
abstract class test {
|
||||
public $a;
|
||||
}
|
||||
$mysqli->query("SELECT 1 as a")->fetch_object("test");
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class 'test' cannot be instantiated in %sbug74968.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug74968.php(%d): mysqli_result->fetch_object('test')
|
||||
#1 {main}
|
||||
thrown in %sbug74968.php on line %d
|
||||
@@ -38,7 +38,7 @@ if (!$IS_MYSQLND)
|
||||
|
||||
function poll_async($offset, $link, $links, $errors, $reject, $exp_ready, $use_oo_syntax) {
|
||||
|
||||
if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 1000)))
|
||||
if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 2000)))
|
||||
printf("[%03d + 1] There should be %d links ready to read from, %d ready\n",
|
||||
$offset, $exp_ready, $tmp);
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ if (PHP_OCI8 != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
|
||||
CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
|
||||
{
|
||||
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
|
||||
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c');
|
||||
|
||||
AC_DEFINE('HAVE_OCI8', 1);
|
||||
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
|
||||
|
||||
+7
-1
@@ -509,6 +509,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_register_taf_callback, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, connection_resource)
|
||||
ZEND_ARG_INFO(0, function_name)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_unregister_taf_callback, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, connection_resource)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
|
||||
/* {{{ LOB Method arginfo */
|
||||
@@ -707,6 +711,7 @@ PHP_FUNCTION(oci_collection_size);
|
||||
PHP_FUNCTION(oci_collection_max);
|
||||
PHP_FUNCTION(oci_collection_trim);
|
||||
PHP_FUNCTION(oci_register_taf_callback);
|
||||
PHP_FUNCTION(oci_unregister_taf_callback);
|
||||
/* }}} */
|
||||
|
||||
/* {{{ extension definition structures
|
||||
@@ -790,6 +795,7 @@ static const zend_function_entry php_oci_functions[] = {
|
||||
PHP_FE(oci_collection_trim, arginfo_oci_collection_trim)
|
||||
PHP_FE(oci_new_collection, arginfo_oci_new_collection)
|
||||
PHP_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback)
|
||||
PHP_FE(oci_unregister_taf_callback, arginfo_oci_unregister_taf_callback)
|
||||
|
||||
PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
@@ -2702,7 +2708,7 @@ static int php_oci_persistent_helper(zval *zv)
|
||||
|
||||
/* Remove TAF callback function as it's bound to current request */
|
||||
if (connection->used_this_request && !Z_ISUNDEF(connection->taf_callback) && !Z_ISNULL(connection->taf_callback)) {
|
||||
php_oci_disable_taf_callback(connection);
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
}
|
||||
|
||||
if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
+14
-13
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -42,27 +42,28 @@
|
||||
|
||||
/* {{{ callback_fn()
|
||||
OCI TAF callback function, calling userspace function */
|
||||
sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4 fo_type, ub4 fo_event)
|
||||
sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_event)
|
||||
{
|
||||
/* Create zval */
|
||||
zval retval, params[3];
|
||||
php_oci_connection *connection = (php_oci_connection*)fo_ctx;
|
||||
|
||||
/* Default return value */
|
||||
sb4 returnValue = 0;
|
||||
|
||||
/* Check if userspace callback function was disabled */
|
||||
if (Z_ISUNDEF(fo_ctx->taf_callback) || Z_ISNULL(fo_ctx->taf_callback)) {
|
||||
/* Check if userspace callback function was unregistered */
|
||||
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize zval */
|
||||
ZVAL_RES(¶ms[0], fo_ctx->id);
|
||||
ZVAL_RES(¶ms[0], connection->id);
|
||||
ZVAL_LONG(¶ms[1], fo_event);
|
||||
ZVAL_LONG(¶ms[2], fo_type);
|
||||
|
||||
/* Call user function (if possible) */
|
||||
if (call_user_function(EG(function_table), NULL, &fo_ctx->taf_callback, &retval, 3, params) == FAILURE) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call taf callback function, is it defined?");
|
||||
if (call_user_function(EG(function_table), NULL, &connection->taf_callback, &retval, 3, params) == FAILURE) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call Oracle TAF callback function");
|
||||
}
|
||||
|
||||
/* Set return value */
|
||||
@@ -83,10 +84,10 @@ sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_oci_disable_taf_callback()
|
||||
Disables the userspace callback function for Oracle TAF,
|
||||
/* {{{ php_oci_unregister_taf_callback()
|
||||
Unregister the userspace callback function for Oracle TAF,
|
||||
while keeping the OCI callback alive */
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection)
|
||||
int php_oci_unregister_taf_callback(php_oci_connection *connection)
|
||||
{
|
||||
return php_oci_register_taf_callback(connection, NULL);
|
||||
}
|
||||
@@ -103,9 +104,9 @@ int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback
|
||||
OCIFocbkStruct failover;
|
||||
|
||||
if (!callback) {
|
||||
/* Disable callback */
|
||||
/* Unregister callback */
|
||||
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
|
||||
return 0; // Nothing to disable
|
||||
return 0; // Nothing to unregister
|
||||
}
|
||||
|
||||
registered = 1;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -56,13 +56,21 @@ PHP_FUNCTION(oci_register_taf_callback)
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2)
|
||||
if (!zend_is_callable(callback, 0, 0)) {
|
||||
callback_name = zend_get_callable_name(callback);
|
||||
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
|
||||
zend_string_release(callback_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
if (!zend_is_callable(callback, 0, &callback_name)) {
|
||||
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
|
||||
zend_string_release(callback_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
zend_string_release(callback_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
@@ -75,6 +83,27 @@ PHP_FUNCTION(oci_register_taf_callback)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool oci_unregister_taf_callback( resource connection )
|
||||
* Unregister a callback function for Oracle Transparent Application Failover (TAF) */
|
||||
PHP_FUNCTION(oci_unregister_taf_callback)
|
||||
{
|
||||
zval *z_connection;
|
||||
php_oci_connection *connection;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
|
||||
if (php_oci_unregister_taf_callback(connection) == 0) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool oci_define_by_name(resource stmt, string name, mixed &var [, int type])
|
||||
Define a PHP variable to an Oracle column by name */
|
||||
/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */
|
||||
@@ -1587,8 +1616,8 @@ PHP_FUNCTION(oci_close)
|
||||
RefCount value by 1 */
|
||||
zend_list_close(connection->id);
|
||||
|
||||
/* Disable Oracle TAF */
|
||||
php_oci_disable_taf_callback(connection);
|
||||
/* Unregister Oracle TAF */
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
|
||||
/* ZVAL_NULL(z_connection); */
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
+43
-6
@@ -12,7 +12,7 @@ Use the OCI8 extension to access Oracle Database. Use 'pecl install
|
||||
oci8' to install for PHP 7. Use 'pecl install oci8-2.0.12' to install
|
||||
for PHP 5.2 - PHP 5.6. Use 'pecl install oci8-1.4.10' to install for
|
||||
PHP 4.3.9 - PHP 5.1. The OCI8 extension can be linked with Oracle
|
||||
client libraries from Oracle Database 12.1, 11, or 10.2. These
|
||||
client libraries from Oracle Database 12, 11, or 10.2. These
|
||||
libraries are found in your database installation, or in the free
|
||||
Oracle Instant Client from
|
||||
http://www.oracle.com/technetwork/database/features/instant-client/.
|
||||
@@ -27,6 +27,12 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<email>sixd@php.net</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Tianfang Yang</name>
|
||||
<user>tianfyan</user>
|
||||
<email>tianfyan@php.net</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Antony Dovgal</name>
|
||||
<user>tony2001</user>
|
||||
@@ -46,12 +52,12 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<active>no</active>
|
||||
</lead>
|
||||
|
||||
<date>2017-06-20</date>
|
||||
<date>2017-08-15</date>
|
||||
<time>12:00:00</time>
|
||||
|
||||
<version>
|
||||
<release>2.1.5</release>
|
||||
<api>2.1.5</api>
|
||||
<release>2.1.7</release>
|
||||
<api>2.1.7</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
@@ -60,8 +66,7 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Added TAF callback support (PR #2459, KoenigsKind)
|
||||
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
Added oci_unregister_taf_callback()
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
@@ -471,6 +476,38 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
</extsrcrelease>
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.6</release>
|
||||
<api>2.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.5</release>
|
||||
<api>2.1.5</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Added TAF callback support (PR #2459, KoenigsKind)
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.4</release>
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -43,7 +43,7 @@
|
||||
*/
|
||||
#undef PHP_OCI8_VERSION
|
||||
#endif
|
||||
#define PHP_OCI8_VERSION "2.1.5"
|
||||
#define PHP_OCI8_VERSION "2.1.7"
|
||||
|
||||
extern zend_module_entry oci8_module_entry;
|
||||
#define phpext_oci8_ptr &oci8_module_entry
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -536,7 +536,7 @@ ZEND_END_MODULE_GLOBALS(oci) /* }}} */
|
||||
/* {{{ transparent failover related prototypes */
|
||||
|
||||
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback);
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection);
|
||||
int php_oci_unregister_taf_callback(php_oci_connection *connection);
|
||||
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
--TEST--
|
||||
Bug #72524 (Binding null values triggers ORA-24816 error)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
|
||||
require(dirname(__FILE__).'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
// Initialize
|
||||
|
||||
$stmtarray = array(
|
||||
"CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
// Run test
|
||||
|
||||
$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
|
||||
|
||||
echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n";
|
||||
$stmt = oci_parse($c, $sql);
|
||||
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n";
|
||||
|
||||
$clob = '';
|
||||
$varchar2 = '';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n";
|
||||
$clob = 'abc';
|
||||
$varchar2 = 'abc';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG);
|
||||
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
// Cleanup
|
||||
|
||||
$stmtarray = array(
|
||||
"DROP TABLE mytable"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default
|
||||
bool(true)
|
||||
Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
--TEST--
|
||||
Bug #72524 (Binding null values triggers ORA-24816 error)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
|
||||
require(dirname(__FILE__).'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
// Initialize
|
||||
|
||||
$stmtarray = array(
|
||||
"CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
// Run test
|
||||
|
||||
$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
|
||||
|
||||
echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n";
|
||||
$stmt = oci_parse($c, $sql);
|
||||
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n";
|
||||
|
||||
$clob = '';
|
||||
$varchar2 = '';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n";
|
||||
$clob = 'abc';
|
||||
$varchar2 = 'abc';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG);
|
||||
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
// Cleanup
|
||||
|
||||
$stmtarray = array(
|
||||
"DROP TABLE mytable"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default
|
||||
bool(true)
|
||||
Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -13,7 +13,7 @@ require(dirname(__FILE__).'/skipif.inc');
|
||||
|
||||
require dirname(__FILE__)."/connect.inc";
|
||||
|
||||
$ora_sql = "DROP TYPE ".$type_name;;
|
||||
$ora_sql = "DROP TYPE ".$type_name;
|
||||
$statement = oci_parse($c,$ora_sql);
|
||||
@oci_execute($statement);
|
||||
|
||||
|
||||
@@ -57,11 +57,11 @@ function get_attr($conn)
|
||||
?>
|
||||
--EXPECT--
|
||||
**Test 1.1 - Default values for the attribute **************
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
|
||||
***Test 1.2 - Get the values from different connections **************
|
||||
Testing with oci_pconnect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
Testing with oci_new_connect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
Done
|
||||
@@ -29,9 +29,9 @@ for ($i = 0; $i < NUMLOBS; $i++) {
|
||||
}
|
||||
|
||||
for ($i = 0; $i < NUMLOBS; $i++) {
|
||||
echo "Row $i Size: " . $row[$i][0]->size() . "\n";;
|
||||
echo "Row $i Size: " . $row[$i][0]->size() . "\n";
|
||||
echo "Pos 1: " . $row[$i][0]->tell() . "\n";
|
||||
echo "Data: " . $row[$i][0]->read(5) . "\n";;
|
||||
echo "Data: " . $row[$i][0]->read(5) . "\n";
|
||||
echo "Pos 2: " . $row[$i][0]->tell() . "\n";
|
||||
echo "Data: " . $row[$i][0]->read(12) . "\n";
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ var_dump($row);
|
||||
|
||||
echo "Test 2 Manipulate the data using SimpleXML\n";
|
||||
|
||||
$sx = simplexml_load_string((binary)$row[0]->load());
|
||||
$sx = simplexml_load_string($row[0]->load());
|
||||
$row[0]->free();
|
||||
var_dump($sx);
|
||||
|
||||
@@ -178,4 +178,4 @@ string(%d) "<?xml version="1.0"?>
|
||||
%sVClearance>10</VClearance>
|
||||
</Warehouse>
|
||||
"
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -144,11 +144,11 @@ op1_use:
|
||||
}
|
||||
} else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
|
||||
var_num = EX_VAR_TO_NUM(opline->op1.var);
|
||||
if (!DFG_ISSET(def, set_size, j, var_num)) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
}
|
||||
if (opline->opcode == ZEND_VERIFY_RETURN_TYPE) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
DFG_SET(def, set_size, j, var_num);
|
||||
} else if (!DFG_ISSET(def, set_size, j, var_num)) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
}
|
||||
}
|
||||
if (opline->op2_type == IS_CV) {
|
||||
|
||||
@@ -3279,9 +3279,11 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
|
||||
zend_ssa_var_info *ssa_var_info = ssa->var_info;
|
||||
int ssa_vars_count = ssa->vars_count;
|
||||
int i, j;
|
||||
uint32_t tmp;
|
||||
uint32_t tmp, worklist_len = zend_bitset_len(ssa_vars_count);
|
||||
|
||||
WHILE_WORKLIST(worklist, zend_bitset_len(ssa_vars_count), j) {
|
||||
while (!zend_bitset_empty(worklist, worklist_len)) {
|
||||
j = zend_bitset_first(worklist, worklist_len);
|
||||
zend_bitset_excl(worklist, j);
|
||||
if (ssa_vars[j].definition_phi) {
|
||||
zend_ssa_phi *p = ssa_vars[j].definition_phi;
|
||||
if (p->pi >= 0) {
|
||||
@@ -3340,7 +3342,7 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
} WHILE_WORKLIST_END();
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #74980 (Narrowing occurred during type inference)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
static function foo()
|
||||
{
|
||||
while ($undef) {
|
||||
$arr[][] = NULL;
|
||||
}
|
||||
|
||||
foreach ($arr as $a) {
|
||||
bar($a + []);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Incorrect liveness computation for verify-return
|
||||
--FILE--
|
||||
<?php
|
||||
function test($foo): string
|
||||
{
|
||||
switch ($foo) {
|
||||
default: $bar = 'x'; break;
|
||||
case 'z': $bar = 'y'; break;
|
||||
}
|
||||
return (string)$bar;
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+15
-23
@@ -87,14 +87,6 @@
|
||||
#define HAVE_EVP_PKEY_EC 1
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
|
||||
#else
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
|
||||
#endif
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(openssl)
|
||||
|
||||
/* FIXME: Use the openssl constants instead of
|
||||
@@ -1129,7 +1121,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
|
||||
if (str == NULL) {
|
||||
php_openssl_store_errors();
|
||||
} else if (!php_openssl_open_base_dir_chk(str)) {
|
||||
BIO *oid_bio = BIO_new_file(str, "r");
|
||||
BIO *oid_bio = BIO_new_file(str, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
if (oid_bio) {
|
||||
OBJ_create_objects(oid_bio);
|
||||
BIO_free(oid_bio);
|
||||
@@ -1690,7 +1682,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
|
||||
return NULL;
|
||||
}
|
||||
|
||||
in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), "r");
|
||||
in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
if (in == NULL) {
|
||||
php_openssl_store_errors();
|
||||
return NULL;
|
||||
@@ -1755,7 +1747,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
|
||||
return;
|
||||
}
|
||||
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out) {
|
||||
if (!notext && !X509_print(bio_out, cert)) {
|
||||
php_openssl_store_errors();
|
||||
@@ -2466,7 +2458,7 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!(in=BIO_new_file(certfile, "r"))) {
|
||||
if(!(in=BIO_new_file(certfile, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY)))) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "error opening the file, %s", certfile);
|
||||
sk_X509_free(stack);
|
||||
@@ -2817,7 +2809,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
|
||||
|
||||
p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0);
|
||||
if (p12 != NULL) {
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out != NULL) {
|
||||
|
||||
i2d_PKCS12_bio(bio_out, p12);
|
||||
@@ -3230,7 +3222,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
return NULL;
|
||||
}
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -3278,7 +3270,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
|
||||
return;
|
||||
}
|
||||
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out != NULL) {
|
||||
if (!notext && !X509_REQ_print(bio_out, csr)) {
|
||||
php_openssl_store_errors();
|
||||
@@ -3803,7 +3795,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
/* not a X509 certificate, try to retrieve public key */
|
||||
BIO* in;
|
||||
if (filename) {
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -3822,7 +3814,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -4499,7 +4491,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
|
||||
PHP_SSL_REQ_INIT(&req);
|
||||
|
||||
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5035,7 +5027,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
dataout = BIO_new_file(datafilename, "w");
|
||||
dataout = BIO_new_file(datafilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (dataout == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5056,7 +5048,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
certout = BIO_new_file(signersfilename, "w");
|
||||
certout = BIO_new_file(signersfilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (certout) {
|
||||
int i;
|
||||
signers = PKCS7_get0_signers(p7, NULL, (int)flags);
|
||||
@@ -5133,7 +5125,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
outfile = BIO_new_file(outfilename, "w");
|
||||
outfile = BIO_new_file(outfilename, PHP_OPENSSL_BIO_MODE_W(flags));
|
||||
if (outfile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5292,7 +5284,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
outfile = BIO_new_file(outfilename, "w");
|
||||
outfile = BIO_new_file(outfilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (outfile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "error opening output file %s!", outfilename);
|
||||
@@ -5927,7 +5919,7 @@ PHP_FUNCTION(openssl_seal)
|
||||
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx));
|
||||
EVP_CIPHER_CTX_cleanup(ctx);
|
||||
|
||||
if (!EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
|
||||
if (EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) <= 0 ||
|
||||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
|
||||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
|
||||
efree(buf);
|
||||
|
||||
@@ -127,6 +127,15 @@ PHP_FUNCTION(openssl_spki_export);
|
||||
PHP_FUNCTION(openssl_spki_export_challenge);
|
||||
|
||||
PHP_FUNCTION(openssl_get_cert_locations);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
|
||||
#else
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define phpext_openssl_ptr NULL
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEFhMCUk8x
|
||||
EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
|
||||
cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
|
||||
IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
|
||||
NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
|
||||
YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
|
||||
A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
|
||||
KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEApNj7XXz8T8FcLIWpBniPYom3QcT6T7u0xRPHqtqzj5oboBYp
|
||||
DJe5d354/y0gJTpiLt8+fTrPgWXnbHm3pOHgXzTcX6Arani0GDU0/xDi4VkCRGcS
|
||||
YqX2sJpcDzAbmK9UDMt3xf/O1B8AJan3RfO0Bm3ozTEPziLMkmsiYr5b/L4CAwEA
|
||||
AaOCAfwwggH4MAkGA1UdEwQCMAAwNQYJYIZIAYb4QgENBCgWJkZvciBHcmlkIHVz
|
||||
ZSBvbmx5OyByZXF1ZXN0IHRhZyB1c2VyVGFnMBEGCWCGSAGG+EIBAQQEAwIF4DA/
|
||||
BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vbW9iaWxlLmJsdWUtc29mdHdhcmUucm86
|
||||
OTAvY2EvY3JsLnNodG1sMDUGCWCGSAGG+EIBCAQoFiZodHRwOi8vbW9iaWxlLmJs
|
||||
dWUtc29mdHdhcmUucm86OTAvcHViLzAhBgNVHREEGjAYgRZzZXJnaXVAYmx1ZXNv
|
||||
ZnR3YXJlLnJvMB0GA1UdDgQWBBSwp//5QRXeIzm93TEPl6CyonTg/DCBpwYDVR0j
|
||||
BIGfMIGcoYGWpIGTMIGQMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9tYW5pYTEQ
|
||||
MA4GA1UEBxMHQ3JhaW92YTEPMA0GA1UEChMGU2VyZ2l1MRMwEQYDVQQLEwpTZXJn
|
||||
aXUgU1JMMRIwEAYDVQQDEwlTZXJnaXUgQ0ExIzAhBgkqhkiG9w0BCQEWFG5fc2Vy
|
||||
Z2l1QGhvdG1haWwuY29tggEAMAsGA1UdDwQEAwIE8DAjBglghkgBhvhCAQIEFhYU
|
||||
aHR0cDovLzYyLjIzMS45OC41Mi8wCwYDKgMEBAQ+52I0MA0GCSqGSIb3DQEBBAUA
|
||||
A4GBAIBIOJ+iiLyQfNJEY+IMefayQea0nmuXYY+F+L1DFjSC7xChytgYoPNnKkhh
|
||||
3dWPtxbswiqKYUnGi6y3Hi4UhDsOaDW29t2S305hSc2qgjOiNtRYQIVYQ8EHG1k7
|
||||
Fl63S7uCOhnVJt+4MnUK1N6/pwgsp+Z2GvEsDG1qCKnvNpf6
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74651: negative-size-param (-1) in memcpy in zif_openssl_seal()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$inputstr = file_get_contents(__DIR__ . "/74651.pem");
|
||||
$pub_key_id = openssl_get_publickey($inputstr);
|
||||
var_dump($pub_key_id);
|
||||
var_dump(openssl_seal($inputstr, $sealed, $ekeys, array($pub_key_id, $pub_key_id), 'AES-128-ECB'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (OpenSSL key)
|
||||
bool(false)
|
||||
@@ -0,0 +1,83 @@
|
||||
--TEST--
|
||||
Bug #74903 openssl_pkcs7_encrypt() uses different EOL than before
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$cert = "-----BEGIN CERTIFICATE-----
|
||||
MIIDXDCCAkSgAwIBAgIKq/f5U3FzthdKUzANBgkqhkiG9w0BAQUFADBcMRIwEAYD
|
||||
VQQDEwlzZXRhcGRmLWExCTAHBgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcN
|
||||
AQkBFhRzdXBwb3J0QHNldGFzaWduLmNvbTELMAkGA1UEBhMCREUwHhcNMTUwOTA4
|
||||
MDkzNDExWhcNMjAwOTA4MDkzNDExWjBcMRIwEAYDVQQDEwlzZXRhcGRmLWExCTAH
|
||||
BgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QHNldGFz
|
||||
aWduLmNvbTELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
||||
AoIBAQCkmTLvUIYfqAKC1CHVgABlemrFIVRm4JGeB0jIGofyrm3yVwR4YcK0eUmt
|
||||
/0nbFfsFsU0/C9dXKZYD42t5YpLFsj666Z1EoU1CfSIW2bf0HaWVJ+oNT5twS3dv
|
||||
RTzAcnPM44GxO4y6GUW6un0/bT/MZbFKbb3NI1L0mwY7EoqUXR68XxuHqWETaslm
|
||||
Sbp1XvbLsJjgV9X3ihi7JC7A9kEzrKh+RBsXEXwlSv5JO2TUdwq9P4EbjqvgiaV1
|
||||
vFNAArioX5pIUIm9ahAm8d7jjW6DFfV798rTzaQ3GJs0yC3UD6xhmbTbdC/D9Pot
|
||||
8RGu89Fx6E+O5j4LwGH4kiYjgvYZAgMBAAGjIDAeMA8GCSqGSIb3LwEBCgQCBQAw
|
||||
CwYDVR0PBAQDAgOYMA0GCSqGSIb3DQEBBQUAA4IBAQBCA8iXz7zxAmCWNZ0faiLm
|
||||
aKw8u2PUq+EPKrGKc9Q70Ksw/e/EHvWrghFzmu5MOZRn/QIWq++sbbc8eOiaRDE8
|
||||
lWCW596FLW4habXKw0sjDNcyEBArPgDp17O6NgHqI2U1KL1P2Y40e0YH2BWxNS+f
|
||||
pmWZekjiC6jfId2JGsyPZUTX4USwthG4dFX0/BWYg+K7kXvQzMobes2NxW3Iqn8h
|
||||
FUNgraCzlQMSfE2gwAMSUXTJubUGorj4LFYSiLIIJvf6KlmuR5uOIi5lSjSeZf5E
|
||||
FLEHVhrz3o2icUeyb1K1BTAQRZ/H3GZ0QpgqSK5vmuV9C+rzezQMoy4/8UUnNPMt
|
||||
-----END CERTIFICATE-----
|
||||
";
|
||||
|
||||
$pkey = "-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkmTLvUIYfqAKC
|
||||
1CHVgABlemrFIVRm4JGeB0jIGofyrm3yVwR4YcK0eUmt/0nbFfsFsU0/C9dXKZYD
|
||||
42t5YpLFsj666Z1EoU1CfSIW2bf0HaWVJ+oNT5twS3dvRTzAcnPM44GxO4y6GUW6
|
||||
un0/bT/MZbFKbb3NI1L0mwY7EoqUXR68XxuHqWETaslmSbp1XvbLsJjgV9X3ihi7
|
||||
JC7A9kEzrKh+RBsXEXwlSv5JO2TUdwq9P4EbjqvgiaV1vFNAArioX5pIUIm9ahAm
|
||||
8d7jjW6DFfV798rTzaQ3GJs0yC3UD6xhmbTbdC/D9Pot8RGu89Fx6E+O5j4LwGH4
|
||||
kiYjgvYZAgMBAAECggEABO4JOGF4KOvQanB11HYNXPy4BLA5Pc0RU3M6pvKjen1m
|
||||
sdzRF5Vu/laJIkbchI0xm+Op8X7Wa+gFFBf8RLIS/QyYBCNh2Fe/74M9sYNDFxLJ
|
||||
vjBIOm6VVF1QRhMD7SwoY303adJjpkHCRMPX4z3PjLzJfPYROpsJnaWkf8GwCJ4+
|
||||
kufOhYcE8ekuLX7EzXFU74Uo0OnMEhMJgiAjlHhC21YLkgLoGq45sdktVgvD6sds
|
||||
7BcmH6oUCDCJ8wxUVM1+Ks1D3vKHfeAhCFHvj9M/lf5OWylhmQh4CQf+NMDNsAc6
|
||||
mXNIzUvZEgs/PJpd3SymHchf60m6faJtGv43GsdsgQKBgQDUx8t649O/vGRI26t4
|
||||
4XrzVC2w5271UlhFaRiH03BrV+pECVoH4bw+ZIUuGke2xe+LrNkhMNJSGcbB0WDa
|
||||
Jes+4Gf++AuSXRvMo+xHenfgUWQqYHJPkh5q6gknZ2YDfikFNLdqApXvp0m+FaVP
|
||||
+F/2HMjQfTITQgkAiEn45s4agQKBgQDGCAZkIUcdyXQTplLE0Zx1/uiTBrQGyzsb
|
||||
cDgAQIHt19wIRjoGOFatAj6TQ5gUj9Remn12v6d5Wi02i7hlu8V6O1VXLGqqeQ27
|
||||
0MHBXzrFBVljOz96D7VP5Xx0DB1cGMbtg5ivjd91OUVrwC7fbXE9sfOI1FqlTb7p
|
||||
6xi9Wl+fmQKBgGdzR/vUfqPOvVcq7gBUaAmb2KcUrj65rU753MJUy2h1EuHHRi1k
|
||||
07fl+VZD0rALJf7bp6laajcebyLWYGdPXkNwqT8ua7naaOSiogLSiSvXhoKP56PG
|
||||
H+HNLWwp+lAia2Erky0IWstsow62yWvLDyTCM+QhqlHwnh3TJVvNI1GBAoGAUl+y
|
||||
MOJ6z5Ql2aqc0UwT1i1Tlxz5s73D93Tlho1Ovp3E5Bg6OK4kt9CwMNe0IhF2GGgQ
|
||||
+l1cj6kIF6Fk8cR6r46QwDM0p3a1VMPQZNx0+NFxzkot7FsuY26lJyyG5fFUhiXw
|
||||
VE4ifoN1Mg3+MWg3657jG66hihNd77WgU9uM3TkCgYEAypuvVrfFrrtXnbEUcBHq
|
||||
mguKumn9miD9DPb6gi8ZaKOddGzw+qFPukiqi7rM3oRMg02evfK/VQC87Gmev663
|
||||
RV9sQOlB9gNlMOOw/0R3ABEWDoSRCcrLhb6Z5Y72WVnZvpTPO0cDw2i1hyaEM6d+
|
||||
2WR7c6FhRCLxG0DObEOfiO0=
|
||||
-----END PRIVATE KEY-----
|
||||
";
|
||||
|
||||
$envelopeData = "Test";
|
||||
|
||||
$tmpFileIn = tempnam(sys_get_temp_dir(), 'test');
|
||||
$tmpFileOut = tempnam(sys_get_temp_dir(), 'test');
|
||||
file_put_contents($tmpFileIn, $envelopeData);
|
||||
|
||||
openssl_pkcs7_encrypt($tmpFileIn, $tmpFileOut, [$cert], array(), PKCS7_BINARY, OPENSSL_CIPHER_AES_128_CBC);
|
||||
|
||||
$result = file_get_contents($tmpFileOut);
|
||||
var_dump(strpos($result, "\r\n") === false); // behaviour before 7.2
|
||||
var_dump(strlen($result) === 847);
|
||||
|
||||
unlink($tmpFileIn);
|
||||
unlink($tmpFileOut);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
==DONE==
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
--TEST--
|
||||
openssl_pkcs12_export_to_file() tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
|
||||
|
||||
$cert_file = dirname(__FILE__) . "/public.crt";
|
||||
$cert = file_get_contents($cert_file);
|
||||
$cert_path = "file://" . $cert_file;
|
||||
$priv_file = dirname(__FILE__) . "/private.crt";
|
||||
$priv = file_get_contents($priv_file);
|
||||
$priv_path = "file://" . $priv_file;
|
||||
$cert_res = openssl_x509_read($cert);
|
||||
$priv_res = openssl_pkey_get_private($priv);
|
||||
$pass = "test";
|
||||
$invalid = "";
|
||||
$invalid_path = "file:///tmp/php";
|
||||
$opts = [];
|
||||
|
||||
var_dump(openssl_pkcs12_export_to_file($cert, $pkcsfile, $priv, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_path, $pkcsfile, $priv_path, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_res, $pkcsfile, $priv_res, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_res, $pkcsfile, $priv_res, $pass, array($cert)));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
|
||||
var_dump(openssl_pkcs12_export_to_file($invalid, $pkcsfile, $invalid, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($invalid_path, $pkcsfile, $invalid_path, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($priv_res, $pkcsfile, $cert_res, $pass));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
if (file_exists($pkcsfile)) {
|
||||
unlink($pkcsfile);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): supplied resource is not a valid OpenSSL X.509 resource in %s on line %d
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
@@ -1170,7 +1170,7 @@ static int set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /* {{{ */
|
||||
}
|
||||
|
||||
convert_to_string_ex(zdhpath);
|
||||
bio = BIO_new_file(Z_STRVAL_P(zdhpath), "r");
|
||||
bio = BIO_new_file(Z_STRVAL_P(zdhpath), PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
|
||||
if (bio == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "invalid dh_param");
|
||||
|
||||
@@ -7307,7 +7307,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
|
||||
|
||||
if (*matchingpath == OP_FAIL)
|
||||
stacksize = 0;
|
||||
if (*matchingpath == OP_RREF)
|
||||
else if (*matchingpath == OP_RREF)
|
||||
{
|
||||
stacksize = GET2(matchingpath, 1);
|
||||
if (common->currententry == NULL)
|
||||
|
||||
@@ -327,7 +327,7 @@ static int mysql_handle_commit(pdo_dbh_t *dbh)
|
||||
PDO_DBG_ENTER("mysql_handle_commit");
|
||||
PDO_DBG_INF_FMT("dbh=%p", dbh);
|
||||
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
|
||||
PDO_DBG_RETURN(0 <= mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
|
||||
PDO_DBG_RETURN(0 == mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
|
||||
#else
|
||||
PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH PHAR 1 "2016" "The PHP Group" "User Commands"
|
||||
.TH PHAR 1 "2017" "The PHP Group" "User Commands"
|
||||
.SH NAME
|
||||
phar, phar.phar \- PHAR (PHP archive) command line tool
|
||||
.SH SYNOPSIS
|
||||
@@ -507,7 +507,7 @@ contributors all around the world.
|
||||
.SH VERSION INFORMATION
|
||||
This manpage describes \fBphar\fP, version @PHP_VERSION@.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1997\-2016 The PHP Group
|
||||
Copyright \(co 1997\-2017 The PHP Group
|
||||
.LP
|
||||
This source file is subject to version 3.01 of the PHP license,
|
||||
that is bundled with this package in the file LICENSE, and is
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Phar: PHP bug #74991: include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip");
|
||||
--INI--
|
||||
phar.readonly=0
|
||||
--FILE--
|
||||
<?php
|
||||
// create a sample file in a custom include_path to lookup from the phar later:
|
||||
mkdir('path');
|
||||
touch('path/needle.php');
|
||||
$p = new Phar('sample.phar');
|
||||
// the use of a sub path is crucial, and make the include_path 1 byte larger (=OVERFLOW) than the MAXPATHLEN, the include_path will then be truncated to 4096 (MAXPATHLEN) into 'phar://..sample.phar/some:xx..xx:pat' so it will fail to find needle.php:
|
||||
$p['some/file'] = "<?php const MAXPATHLEN = 4096, OVERFLOW = 1, PATH = 'path'; set_include_path(str_repeat('x', MAXPATHLEN - strlen(__DIR__ . PATH_SEPARATOR . PATH_SEPARATOR . PATH) + OVERFLOW) . PATH_SEPARATOR . PATH); require('needle.php');";
|
||||
$p->setStub("<?php Phar::mapPhar('sample.phar'); __HALT_COMPILER();");
|
||||
// execute the phar code:
|
||||
require('phar://sample.phar/some/file');
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink('path/needle.php');
|
||||
unlink('sample.phar');
|
||||
rmdir('path');
|
||||
--EXPECT--
|
||||
+1
-1
@@ -309,7 +309,7 @@ splitted:
|
||||
efree(test);
|
||||
}
|
||||
|
||||
spprintf(&path, MAXPATHLEN, "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
|
||||
spprintf(&path, MAXPATHLEN + 1 + strlen(PG(include_path)), "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
|
||||
efree(arch);
|
||||
ret = php_resolve_path(filename, filename_len, path);
|
||||
efree(path);
|
||||
|
||||
@@ -295,6 +295,15 @@ static zend_function *_copy_function(zend_function *fptr) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void _fix_closure_prototype(zend_function *fptr) /* {{{ */
|
||||
{
|
||||
/* Actually we are setting proxy function's prototype to null
|
||||
* as for it, the prototype is an object not a function
|
||||
* which could cause serias problems, see #74949 */
|
||||
fptr->common.prototype = NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void _free_function(zend_function *fptr) /* {{{ */
|
||||
{
|
||||
if (fptr
|
||||
@@ -603,6 +612,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
|
||||
&& memcmp(ZSTR_VAL(mptr->common.function_name), ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
|
||||
&& (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
|
||||
{
|
||||
_fix_closure_prototype(closure);
|
||||
mptr = closure;
|
||||
} else {
|
||||
closure = NULL;
|
||||
@@ -2364,7 +2374,6 @@ ZEND_METHOD(reflection_generator, getExecutingGenerator)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter [, bool return]) throws ReflectionException
|
||||
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
|
||||
ZEND_METHOD(reflection_parameter, export)
|
||||
@@ -2449,6 +2458,7 @@ ZEND_METHOD(reflection_parameter, __construct)
|
||||
{
|
||||
/* nothing to do. don't set is_closure since is the invoke handler,
|
||||
not the closure itself */
|
||||
_fix_closure_prototype(fptr);
|
||||
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, lcname, lcname_len)) == NULL) {
|
||||
efree(lcname);
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0,
|
||||
@@ -3152,6 +3162,7 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
&& (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj))) != NULL)
|
||||
{
|
||||
/* do nothing, mptr already set */
|
||||
_fix_closure_prototype(mptr);
|
||||
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, name_len)) == NULL) {
|
||||
efree(lcname);
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0,
|
||||
@@ -4278,6 +4289,7 @@ ZEND_METHOD(reflection_class, getMethod)
|
||||
{
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
method and not the closure definition itself */
|
||||
_fix_closure_prototype(mptr);
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
efree(lc_name);
|
||||
} else if (ce == zend_ce_closure && Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
|
||||
@@ -4285,6 +4297,7 @@ ZEND_METHOD(reflection_class, getMethod)
|
||||
&& object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp))) != NULL) {
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
method and not the closure definition itself */
|
||||
_fix_closure_prototype(mptr);
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
zval_dtor(&obj_tmp);
|
||||
efree(lc_name);
|
||||
@@ -4311,6 +4324,7 @@ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval,
|
||||
&& memcmp(ZSTR_VAL(mptr->common.function_name), ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
|
||||
&& (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
|
||||
{
|
||||
_fix_closure_prototype(closure);
|
||||
mptr = closure;
|
||||
}
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
@@ -4362,6 +4376,7 @@ ZEND_METHOD(reflection_class, getMethods)
|
||||
if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure)) {
|
||||
zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj));
|
||||
if (closure) {
|
||||
_fix_closure_prototype(closure);
|
||||
_addmethod(closure, ce, return_value, filter, &intern->obj);
|
||||
_free_function(closure);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ object(ReflectionClass)#4 (1) {
|
||||
}
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
stdClass
|
||||
Method [ <internal, prototype Closure> public method __invoke ] {
|
||||
Method [ <internal> public method __invoke ] {
|
||||
|
||||
- Parameters [1] {
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74949 (null pointer dereference in _function_string)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$f = function () {};
|
||||
|
||||
$r = new ReflectionMethod($f, "__invoke");
|
||||
|
||||
unset($f);
|
||||
|
||||
echo $r, "\n";
|
||||
|
||||
try {
|
||||
echo $r->getPrototype();
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Method [ <internal> public method __invoke ] {
|
||||
}
|
||||
|
||||
Method Closure::__invoke does not have a prototype
|
||||
@@ -99,6 +99,9 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
|
||||
static void php_session_send_cookie(void);
|
||||
static void php_session_abort(void);
|
||||
|
||||
/* Initialized in MINIT, readonly otherwise. */
|
||||
static int my_module_number = 0;
|
||||
|
||||
/* Dispatched by RINIT and by php_session_destroy */
|
||||
static inline void php_rinit_session_globals(void) /* {{{ */
|
||||
{
|
||||
@@ -111,6 +114,7 @@ static inline void php_rinit_session_globals(void) /* {{{ */
|
||||
PS(mod_user_is_open) = 0;
|
||||
PS(define_sid) = 1;
|
||||
PS(session_vars) = NULL;
|
||||
PS(module_number) = my_module_number;
|
||||
ZVAL_UNDEF(&PS(http_session_vars));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2620,7 +2624,8 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
|
||||
|
||||
zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL);
|
||||
|
||||
PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */
|
||||
my_module_number = module_number;
|
||||
PS(module_number) = module_number;
|
||||
|
||||
PS(session_status) = php_session_none;
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74833 Session module number is uninitialized when SID is reset
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
|
||||
session_start();
|
||||
session_regenerate_id();
|
||||
$c = get_defined_constants(true);
|
||||
/* Ensure the SID constant has correct module number. */
|
||||
var_dump(isset($c['session']['SID']));
|
||||
|
||||
ob_end_flush();
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
==DONE==
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #74892 Url Rewriting (trans_sid) not working on urls that start with #
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('session.use_cookies', '0');
|
||||
ini_set('session.use_only_cookies',0);
|
||||
ini_set('session.use_trans_sid',1);
|
||||
ini_set('session.trans_sid_hosts','php.net');
|
||||
session_id('sessionidhere');
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<p><a href="index.php">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 5 |
|
||||
| PHP version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -2321,16 +2321,16 @@ SXE_METHOD(__construct)
|
||||
}
|
||||
|
||||
if (ZEND_SIZE_T_INT_OVFL(data_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Data is too long");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Data is too long", 0);
|
||||
return;
|
||||
}
|
||||
if (ZEND_SIZE_T_INT_OVFL(ns_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Namespace is too long");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Namespace is too long", 0);
|
||||
return;
|
||||
}
|
||||
if (ZEND_LONG_EXCEEDS_INT(options)) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid options");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Invalid options", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
docp = is_url ? xmlReadFile(data, NULL, (int)options) : xmlReadMemory(data, (int)data_len, NULL, NULL, (int)options);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74950 (null pointer deref in zim_simplexml_element_getDocNamespaces)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("simplexml")) die("skip SimpleXML not available");
|
||||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xml=new SimpleXMLElement(0,9000000000);var_dump($xml->getDocNamespaces())?>
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Invalid options in %sbug74950.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug74950.php(%d): SimpleXMLElement->__construct('0', 9000000000)
|
||||
#1 {main}
|
||||
thrown in %sbug74950.php on line %d
|
||||
+1
-7
@@ -38,9 +38,9 @@
|
||||
#if HAVE_SNMP
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock2.h>
|
||||
#include <errno.h>
|
||||
#include <process.h>
|
||||
#include "win32/time.h"
|
||||
#elif defined(NETWARE)
|
||||
@@ -49,17 +49,11 @@
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <sys/timeval.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#ifndef _OSD_POSIX
|
||||
#include <sys/errno.h>
|
||||
#else
|
||||
#include <errno.h> /* BS2000/OSD uses <errno.h>, not <sys/errno.h> */
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
||||
+16
-4
@@ -535,8 +535,14 @@ PHP_FUNCTION(spl_autoload_register)
|
||||
ZSTR_VAL(lc_name)[ZSTR_LEN(lc_name)] = '\0';
|
||||
} else {
|
||||
ZVAL_UNDEF(&alfi.closure);
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
/* Skip leading \ */
|
||||
if (ZSTR_VAL(func_name)[0] == '\\') {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name) - 1, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name) + 1, ZSTR_LEN(func_name) - 1);
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
}
|
||||
}
|
||||
zend_string_release(func_name);
|
||||
|
||||
@@ -654,8 +660,14 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
memcpy(ZSTR_VAL(lc_name) + ZSTR_LEN(func_name), &Z_OBJ_HANDLE_P(zcallable), sizeof(uint32_t));
|
||||
ZSTR_VAL(lc_name)[ZSTR_LEN(lc_name)] = '\0';
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
/* Skip leading \ */
|
||||
if (ZSTR_VAL(func_name)[0] == '\\') {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name) - 1, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name) + 1, ZSTR_LEN(func_name) - 1);
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
}
|
||||
}
|
||||
zend_string_release(func_name);
|
||||
|
||||
|
||||
+28
-13
@@ -1740,13 +1740,14 @@ SPL_METHOD(Array, serialize)
|
||||
*/
|
||||
SPL_METHOD(Array, unserialize)
|
||||
{
|
||||
spl_array_object *intern = Z_SPLARRAY_P(getThis());
|
||||
zval *object = getThis();
|
||||
spl_array_object *intern = Z_SPLARRAY_P(object);
|
||||
|
||||
char *buf;
|
||||
size_t buf_len;
|
||||
const unsigned char *p, *s;
|
||||
php_unserialize_data_t var_hash;
|
||||
zval *members, *zflags;
|
||||
zval *members, *zflags, *array;
|
||||
zend_long flags;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
|
||||
@@ -1788,24 +1789,38 @@ SPL_METHOD(Array, unserialize)
|
||||
}
|
||||
++p;
|
||||
|
||||
if (*p!='m') {
|
||||
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||
goto outexcept;
|
||||
}
|
||||
if (flags & SPL_ARRAY_IS_SELF) {
|
||||
/* If IS_SELF is used, the flags are not followed by an array/object */
|
||||
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
||||
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
|
||||
zval_ptr_dtor(&intern->array);
|
||||
ZVAL_UNDEF(&intern->array);
|
||||
if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash)
|
||||
|| (Z_TYPE(intern->array) != IS_ARRAY && Z_TYPE(intern->array) != IS_OBJECT)) {
|
||||
} else {
|
||||
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||
goto outexcept;
|
||||
}
|
||||
var_push_dtor(&var_hash, &intern->array);
|
||||
|
||||
array = var_tmp_var(&var_hash);
|
||||
if (!php_var_unserialize(array, &p, s + buf_len, &var_hash)
|
||||
|| (Z_TYPE_P(array) != IS_ARRAY && Z_TYPE_P(array) != IS_OBJECT)) {
|
||||
goto outexcept;
|
||||
}
|
||||
|
||||
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
||||
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
|
||||
|
||||
if (Z_TYPE_P(array) == IS_ARRAY) {
|
||||
zval_ptr_dtor(&intern->array);
|
||||
ZVAL_COPY(&intern->array, array);
|
||||
} else {
|
||||
spl_array_set_array(object, intern, array, 0L, 1);
|
||||
}
|
||||
|
||||
if (*p != ';') {
|
||||
goto outexcept;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if (*p != ';') {
|
||||
goto outexcept;
|
||||
}
|
||||
++p;
|
||||
|
||||
/* members */
|
||||
if (*p!= 'm' || *++p != ':') {
|
||||
|
||||
@@ -942,6 +942,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object)
|
||||
if (object->iterators) {
|
||||
efree(object->iterators);
|
||||
object->iterators = NULL;
|
||||
object->level = 0;
|
||||
}
|
||||
|
||||
zend_object_std_dtor(&object->std);
|
||||
@@ -3366,7 +3367,7 @@ SPL_METHOD(AppendIterator, __construct)
|
||||
Append an iterator */
|
||||
SPL_METHOD(AppendIterator, append)
|
||||
{
|
||||
spl_dual_it_object *intern;
|
||||
spl_dual_it_object *intern, *appender;
|
||||
zval *it;
|
||||
|
||||
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
|
||||
@@ -3378,6 +3379,11 @@ SPL_METHOD(AppendIterator, append)
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, it);
|
||||
intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator);
|
||||
}else{
|
||||
appender = Z_SPLDUAL_IT_P(it);
|
||||
if (appender->dit_type == DIT_AppendIterator) {
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, &appender->u.append.zarrayit);
|
||||
return;
|
||||
}
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, it);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,45 +8,10 @@ $data = unserialize($exploit);
|
||||
|
||||
var_dump($data);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(ArrayObject)#1 (2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
["storage":"ArrayObject":private]=>
|
||||
object(DateInterval)#2 (16) {
|
||||
["y"]=>
|
||||
int(3)
|
||||
["m"]=>
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(-1)
|
||||
["f"]=>
|
||||
float(-1)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(-1)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in %s
|
||||
Stack trace:
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
@@ -0,0 +1,112 @@
|
||||
--TEST--
|
||||
Bug #74669: Unserialize ArrayIterator broken
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Container implements Iterator
|
||||
{
|
||||
public $container;
|
||||
public $iterator;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new ArrayObject();
|
||||
$this->iterator = $this->container->getIterator();
|
||||
}
|
||||
|
||||
public function append($element)
|
||||
{
|
||||
$this->container->append($element);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return $this->iterator->current();
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
$this->iterator->next();
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return $this->iterator->key();
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return $this->iterator->valid();
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
$this->iterator->rewind();
|
||||
}
|
||||
}
|
||||
|
||||
class SelfArray extends ArrayObject
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this);
|
||||
}
|
||||
}
|
||||
|
||||
$container = new Container();
|
||||
$container->append('test1');
|
||||
$container->append('test2');
|
||||
$container->valid();
|
||||
$serialized = serialize($container);
|
||||
unset($container);
|
||||
|
||||
$container = unserialize($serialized);
|
||||
|
||||
foreach ($container as $key => $value) {
|
||||
echo $key . ' => ' . $value . PHP_EOL;
|
||||
}
|
||||
|
||||
$arObj = new ArrayObject(['test1', 'test2']);
|
||||
$serialized = serialize($container);
|
||||
unset($arObj);
|
||||
|
||||
$arObj = unserialize($serialized);
|
||||
foreach($arObj as $key => $value) {
|
||||
echo $key . ' => ' . $value . PHP_EOL;
|
||||
}
|
||||
|
||||
$payload = 'x:i:33554432;O:8:"stdClass":0:{};m:a:0:{}';
|
||||
$str = 'C:11:"ArrayObject":' . strlen($payload) . ':{' . $payload . '}';
|
||||
|
||||
$ao = unserialize($str);
|
||||
var_dump($ao['foo']);
|
||||
|
||||
$selfArray = new SelfArray();
|
||||
$selfArray['foo'] = 'bar';
|
||||
var_dump($selfArray);
|
||||
$serialized = serialize($selfArray);
|
||||
var_dump($serialized);
|
||||
unset($selfArray);
|
||||
$selfArray = unserialize($serialized);
|
||||
var_dump($selfArray);
|
||||
var_dump($selfArray['foo']);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
0 => test1
|
||||
1 => test2
|
||||
0 => test1
|
||||
1 => test2
|
||||
|
||||
Notice: Undefined index: foo in %s on line %s
|
||||
NULL
|
||||
object(SelfArray)#9 (1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
string(62) "C:9:"SelfArray":41:{x:i:16777216;m:a:1:{s:3:"foo";s:3:"bar";}}"
|
||||
object(SelfArray)#9 (1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
string(3) "bar"
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #74977: Recursion leads to crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$iterator = new AppendIterator(array("A","A","A"));
|
||||
$iterator->append($iterator);
|
||||
var_dump($iterator);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(AppendIterator)#1 (0) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
|
||||
--FILE--
|
||||
<?php
|
||||
class Auto { public static function loader() {}}
|
||||
$autoloader = '\Auto::loader';
|
||||
|
||||
echo (int)spl_autoload_register($autoloader);
|
||||
echo (int)spl_autoload_unregister($autoloader);
|
||||
echo (int)spl_autoload_register($autoloader);
|
||||
foreach (spl_autoload_functions() as $loader) {
|
||||
echo (int)spl_autoload_unregister($loader);
|
||||
}
|
||||
echo (int)count(spl_autoload_functions());
|
||||
--EXPECTF--
|
||||
11110
|
||||
@@ -10,5 +10,6 @@ if (PHP_SQLITE3 != "no") {
|
||||
ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
|
||||
|
||||
AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
|
||||
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function")
|
||||
PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
|
||||
}
|
||||
@@ -53,6 +53,9 @@ if test $PHP_SQLITE3 != "no"; then
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
|
||||
AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled])
|
||||
])
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_errstr,[
|
||||
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
|
||||
[],
|
||||
@@ -86,6 +89,7 @@ if test $PHP_SQLITE3 != "no"; then
|
||||
PHP_INSTALL_HEADERS([ext/sqlite3/libsqlite/sqlite3.h])
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
|
||||
AC_DEFINE(HAVE_SQLITE3,1,[ ])
|
||||
|
||||
sqlite3_sources="sqlite3.c $sqlite3_extra_sources"
|
||||
|
||||
+10
-3
@@ -103,6 +103,7 @@ PHP_METHOD(sqlite3, open)
|
||||
char *filename, *encryption_key, *fullpath;
|
||||
size_t filename_len, encryption_key_len = 0;
|
||||
zend_long flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
|
||||
int rc;
|
||||
|
||||
db_obj = Z_SQLITE3_DB_P(object);
|
||||
|
||||
@@ -133,11 +134,17 @@ PHP_METHOD(sqlite3, open)
|
||||
}
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3005000
|
||||
if (sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL) != SQLITE_OK) {
|
||||
rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL);
|
||||
#else
|
||||
if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
|
||||
rc = sqlite3_open(fullpath, &(db_obj->db));
|
||||
#endif
|
||||
if (rc != SQLITE_OK) {
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s",
|
||||
#ifdef HAVE_SQLITE3_ERRSTR
|
||||
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
|
||||
#else
|
||||
db_obj->db ? sqlite3_errmsg(db_obj->db) : "");
|
||||
#endif
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
|
||||
if (fullpath != filename) {
|
||||
efree(fullpath);
|
||||
}
|
||||
|
||||
@@ -792,6 +792,10 @@ PHP_FUNCTION(unpack)
|
||||
/* Never use any input */
|
||||
case 'X':
|
||||
size = -1;
|
||||
if (arg < 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", type);
|
||||
arg = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case '@':
|
||||
|
||||
@@ -7,7 +7,7 @@ if (stripos(PHP_OS, 'win') !== 0) die("skip windows required");
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$file = dirname(__FILE__)."/flock.dat";
|
||||
$file = dirname(__FILE__)."/flock_bug65272.dat";
|
||||
|
||||
$fp1 = fopen($file, "w");
|
||||
var_dump(flock($fp1, LOCK_SH));
|
||||
@@ -16,9 +16,13 @@ $fp2 = fopen($file, "r");
|
||||
var_dump(flock($fp2, LOCK_EX|LOCK_NB, $wouldblock));
|
||||
var_dump($wouldblock);
|
||||
|
||||
@unlink($file);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$file = dirname(__FILE__)."/flock_bug65272.dat";
|
||||
unlink($file);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
@@ -29,10 +29,13 @@ foreach ($array as $str) {
|
||||
var_dump(fgetss($fp, 10, "<script>,<a>"));
|
||||
}
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/fgetss1.html";
|
||||
unlink($filename);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(21) "askasdfasdf<b>aaaaaa
|
||||
"
|
||||
|
||||
Loaded 100 of 154 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user