mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 19:50:50 +00:00
Compare commits
310
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c672353805 | ||
|
|
2631cdcae0 | ||
|
|
40fc656702 | ||
|
|
176f90ad49 | ||
|
|
e5d767d27f | ||
|
|
6d96fdc68d | ||
|
|
91655b45ea | ||
|
|
9544aac446 | ||
|
|
03596d7648 | ||
|
|
3c10649464 | ||
|
|
e8a89c49db | ||
|
|
5d31ee302d | ||
|
|
68f5289e9e | ||
|
|
38ad37ad43 | ||
|
|
25103c37aa | ||
|
|
9450893dc6 | ||
|
|
d1b1c04398 | ||
|
|
5c963731e2 | ||
|
|
6b631f073d | ||
|
|
46d6daea7a | ||
|
|
e65932060a | ||
|
|
ec589a27da | ||
|
|
65d7ade684 | ||
|
|
2498385dd9 | ||
|
|
8967e66559 | ||
|
|
434c2b1bdb | ||
|
|
128fca4037 | ||
|
|
2d3d72412a | ||
|
|
0db6f5267c | ||
|
|
70dfbe0068 | ||
|
|
b043759cb4 | ||
|
|
bc166844e3 | ||
|
|
315f3f8dc9 | ||
|
|
118ff03335 | ||
|
|
078cdd8f76 | ||
|
|
a53d67ceac | ||
|
|
c0a1c2c5ee | ||
|
|
40d9e3ab86 | ||
|
|
54248b18fe | ||
|
|
10c9d615de | ||
|
|
a221e17b41 | ||
|
|
e450621f5e | ||
|
|
4922049213 | ||
|
|
f3d5877845 | ||
|
|
44b234a9bc | ||
|
|
20e75329f2 | ||
|
|
65f5573bc8 | ||
|
|
bd093ad861 | ||
|
|
a83cc03c13 | ||
|
|
8588ae7215 | ||
|
|
8f8e6f95af | ||
|
|
0f6c41c6f8 | ||
|
|
0697a64f7e | ||
|
|
5d5c1cea5f | ||
|
|
d386ed1e6b | ||
|
|
f2833ca1be | ||
|
|
d6fcaf5da4 | ||
|
|
c283f53b24 | ||
|
|
ecee3f1209 | ||
|
|
5e15c9c41f | ||
|
|
b855907f54 | ||
|
|
685708160e | ||
|
|
3430d856ac | ||
|
|
4e30ab33d8 | ||
|
|
07c5efbd76 | ||
|
|
4a10037cb4 | ||
|
|
0f579fd7c8 | ||
|
|
5240f8391f | ||
|
|
ea372e7463 | ||
|
|
2fb12be84c | ||
|
|
233f507fe6 | ||
|
|
e3e67b721f | ||
|
|
97d192b444 | ||
|
|
706241f82d | ||
|
|
d016434ad3 | ||
|
|
39f95f5614 | ||
|
|
5f9c82d514 | ||
|
|
fa713ec17b | ||
|
|
221345a013 | ||
|
|
ed949a1973 | ||
|
|
881e43a03c | ||
|
|
c2b1182879 | ||
|
|
99a8ec6e24 | ||
|
|
79a606bd95 | ||
|
|
df7417d127 | ||
|
|
78773890f6 | ||
|
|
eda7492604 | ||
|
|
c1f8dd4a33 | ||
|
|
f419e049ff | ||
|
|
bd2b4a5b2e | ||
|
|
b5ce6df0da | ||
|
|
d971b67027 | ||
|
|
96b725122d | ||
|
|
8eaaabdd58 | ||
|
|
25643b56a2 | ||
|
|
77b6e95d92 | ||
|
|
6808968c89 | ||
|
|
00e41a10b8 | ||
|
|
2cab085bb3 | ||
|
|
e0d6c3f7ba | ||
|
|
4e68c53a21 | ||
|
|
00ba784a2c | ||
|
|
0123f75b5d | ||
|
|
9690ded288 | ||
|
|
83738281eb | ||
|
|
0427dcb913 | ||
|
|
b5481defe6 | ||
|
|
0044a81fbb | ||
|
|
dd97cb1665 | ||
|
|
ee3227af48 | ||
|
|
78b44ddeba | ||
|
|
bd6850a282 | ||
|
|
133ac0151b | ||
|
|
c21e901ba7 | ||
|
|
24537a73c0 | ||
|
|
a66d73db4b | ||
|
|
f547412cba | ||
|
|
68dcaa29d8 | ||
|
|
68f80be9d1 | ||
|
|
990bb34891 | ||
|
|
fe55fe1f54 | ||
|
|
b03776adb5 | ||
|
|
9353f11bd2 | ||
|
|
7817fc07e1 | ||
|
|
cf5d46ba94 | ||
|
|
be6d72b3a4 | ||
|
|
7bc1c0cca8 | ||
|
|
6d2bc72530 | ||
|
|
31aca85572 | ||
|
|
824cbc2781 | ||
|
|
f9ba2ca136 | ||
|
|
7424bfc7ac | ||
|
|
ac2e9587fb | ||
|
|
848e24f24d | ||
|
|
8b59e4e897 | ||
|
|
2be27074b6 | ||
|
|
2e84f4d16a | ||
|
|
d5e2431884 | ||
|
|
12a09183b3 | ||
|
|
85d9a1ca6e | ||
|
|
d4bf0799b8 | ||
|
|
4ea01bdc67 | ||
|
|
c7c87515f6 | ||
|
|
d4200ba6cf | ||
|
|
4ef7be20ab | ||
|
|
315b95b065 | ||
|
|
a54f0f7680 | ||
|
|
de58fb34c9 | ||
|
|
9cfd650697 | ||
|
|
7f3bdda29b | ||
|
|
d134c0ac05 | ||
|
|
1359f793ee | ||
|
|
750a74ed9c | ||
|
|
a4c1a43a5b | ||
|
|
d8ff075f12 | ||
|
|
7b5f232b03 | ||
|
|
bc214c8423 | ||
|
|
4b9db65f68 | ||
|
|
7899ac4c14 | ||
|
|
5941b30bb8 | ||
|
|
fb246bec14 | ||
|
|
a29016d70d | ||
|
|
6c6a58e930 | ||
|
|
d9058b61fb | ||
|
|
db8bf0a9e0 | ||
|
|
8fd8a1b128 | ||
|
|
9c7b607320 | ||
|
|
8782c61f26 | ||
|
|
2d01a89ad1 | ||
|
|
12fc8f66e7 | ||
|
|
8488c34fc6 | ||
|
|
74cf2eb83f | ||
|
|
216d6a024a | ||
|
|
73e43b6e19 | ||
|
|
4a469c7e98 | ||
|
|
c1962e900a | ||
|
|
acce991a37 | ||
|
|
0d022ddf03 | ||
|
|
41e4a77077 | ||
|
|
1e53e14bc3 | ||
|
|
5a7f9afb99 | ||
|
|
3c4dd73c02 | ||
|
|
e304468e57 | ||
|
|
9a2e5cfccb | ||
|
|
304141e8f8 | ||
|
|
34179ba809 | ||
|
|
1ed5a2a54d | ||
|
|
7940fb42ce | ||
|
|
62a2387a8d | ||
|
|
b2b9e2e87e | ||
|
|
8bee0fbd37 | ||
|
|
82e5752b0b | ||
|
|
15443f8af4 | ||
|
|
58af1e156e | ||
|
|
07a4185df1 | ||
|
|
229eb15f0e | ||
|
|
5018581410 | ||
|
|
950157942e | ||
|
|
8227a5ff45 | ||
|
|
14d231bd16 | ||
|
|
c8929dc17e | ||
|
|
a2e7b31fac | ||
|
|
90a5d7c2ad | ||
|
|
2e7247c558 | ||
|
|
1895bf7b94 | ||
|
|
ff3878adeb | ||
|
|
e68acd031d | ||
|
|
683c988493 | ||
|
|
9dddfbe755 | ||
|
|
e857dfa7cc | ||
|
|
3b7c8bb973 | ||
|
|
c6e7969f05 | ||
|
|
69ba81d183 | ||
|
|
9ad5381a2f | ||
|
|
aa405b7da2 | ||
|
|
c00816a38f | ||
|
|
bf6873a18e | ||
|
|
7c48479f62 | ||
|
|
233b66c3d2 | ||
|
|
1666cfcca0 | ||
|
|
59f497afac | ||
|
|
773f980e00 | ||
|
|
583093844e | ||
|
|
fd4b072991 | ||
|
|
5733f11ee9 | ||
|
|
2a0e4b88fd | ||
|
|
1616363850 | ||
|
|
662083fc4f | ||
|
|
6f0b232648 | ||
|
|
3f5c47af3b | ||
|
|
a1cee97de1 | ||
|
|
f20a2b4f3c | ||
|
|
5c8b02fdd6 | ||
|
|
ae95d06f68 | ||
|
|
2bceb4bedc | ||
|
|
b5cb999e7f | ||
|
|
b87e43d931 | ||
|
|
bf5f07cc8b | ||
|
|
3928b6b435 | ||
|
|
e08f69194c | ||
|
|
df5efa2fcd | ||
|
|
1fafcd2b28 | ||
|
|
f5afd0a827 | ||
|
|
2899137391 | ||
|
|
205556c191 | ||
|
|
e5b045e6b6 | ||
|
|
035ad0aed5 | ||
|
|
af500b8685 | ||
|
|
c4dc080245 | ||
|
|
95e1a415a5 | ||
|
|
2f5cb702ff | ||
|
|
a9e4321846 | ||
|
|
626705fb9d | ||
|
|
311922ddbe | ||
|
|
7bc112a142 | ||
|
|
f1d8395c77 | ||
|
|
6acfb79276 | ||
|
|
6559fe9126 | ||
|
|
0216630ea2 | ||
|
|
ef385e806f | ||
|
|
4dfbf07644 | ||
|
|
1086e4ec88 | ||
|
|
a49555a9e1 | ||
|
|
54cbee526a | ||
|
|
e74f89d95a | ||
|
|
901d022001 | ||
|
|
610e7d2c77 | ||
|
|
a89ac98f15 | ||
|
|
2576c57a51 | ||
|
|
d30ec2cd85 | ||
|
|
9439d65f0d | ||
|
|
ff0f6c26c2 | ||
|
|
5ed0602ec6 | ||
|
|
f445e9cb93 | ||
|
|
4000780b3d | ||
|
|
19c844594e | ||
|
|
d1feeed7f3 | ||
|
|
730fdc77a7 | ||
|
|
d27dc5c028 | ||
|
|
105132bd6b | ||
|
|
81b2f3e5d9 | ||
|
|
9d1c7f8b13 | ||
|
|
a7544411df | ||
|
|
f23164584e | ||
|
|
740f0f6165 | ||
|
|
e6dc9abdb7 | ||
|
|
70cba36fc9 | ||
|
|
d87c393a18 | ||
|
|
77f43e48ff | ||
|
|
5e7c5a82a5 | ||
|
|
ecd9c42f9e | ||
|
|
c7ceebc42c | ||
|
|
f3ea88bff7 | ||
|
|
33069575d5 | ||
|
|
c3944c4c4f | ||
|
|
9f2d03952d | ||
|
|
c3c76dbfb9 | ||
|
|
efdbc3688b | ||
|
|
d591e1c4f5 | ||
|
|
1aab7db6c8 | ||
|
|
c9abb0c0ac | ||
|
|
202a0697f3 | ||
|
|
f0d2efbadc | ||
|
|
efc52f1754 | ||
|
|
9c136f10cd | ||
|
|
a4f806aa79 | ||
|
|
2bbf2a91aa | ||
|
|
e97aed4ddb | ||
|
|
edddddcea8 | ||
|
|
4e794b7935 |
No files matched your search
@@ -352,7 +352,8 @@ define ____print_ht
|
||||
end
|
||||
printf "[%d] ", $i
|
||||
if $p->key
|
||||
printf "%s => ", $p->key->val
|
||||
____print_str $p->key->val $p->key->len
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
@@ -70,10 +70,13 @@ jobs:
|
||||
include:
|
||||
- env: ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
|
||||
arch: arm64
|
||||
if: type = cron
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
|
||||
@@ -1,10 +1,219 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
04 Feb 2021, PHP 7.4.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80523 (bogus parse error on >4GB source code). (Nikita)
|
||||
. Fixed bug #80384 (filter buffers entire read until file closed). (Adam
|
||||
Seitz, cmb)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #80595 (Resetting POSTFIELDS to empty array breaks request). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #80376 (last day of the month causes runway cpu usage. (Derick)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #67983 (mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to
|
||||
interpret bit columns). (Nikita)
|
||||
. Fixed bug #64638 (Fetching resultsets from stored procedure with cursor
|
||||
fails). (Nikita)
|
||||
. Fixed bug #72862 (segfault using prepared statements on stored procedures
|
||||
that use a cursor). (Nikita)
|
||||
. Fixed bug #77935 (Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP
|
||||
with a cursor). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #77565 (Incorrect locator detection in ZIP-based phars). (cmb)
|
||||
. Fixed bug #69279 (Compressed ZIP Phar extractTo() creates garbage files).
|
||||
(cmb)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #80672 (Null Dereference in SoapClient). (CVE-2021-21702) (cmb,
|
||||
Stas)
|
||||
|
||||
07 Jan 2021, PHP 7.4.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
|
||||
(cmb)
|
||||
. Fixed bug #80345 (PHPIZE configuration has outdated PHP_RELEASE_VERSION).
|
||||
(cmb)
|
||||
. Fixed bug #72964 (White space not unfolded for CC/Bcc headers). (cmb)
|
||||
. Fixed bug #80362 (Running dtrace scripts can cause php to crash).
|
||||
(al at coralnet dot name)
|
||||
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
|
||||
with libtool). (kir dot morozov at gmail dot com)
|
||||
. Fixed bug #80402 (configure filtering out -lpthread). (Nikita)
|
||||
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69625 (FPM returns 200 status on request without
|
||||
SCRIPT_FILENAME env). (Jakub Zelenka)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
|
||||
lack of OCB support). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
|
||||
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
|
||||
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
|
||||
(cmb)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #80458 (PDOStatement::fetchAll() throws for upsert queries).
|
||||
(Kamil Tekiela)
|
||||
. Fixed bug #63185 (nextRowset() ignores MySQL errors with native prepared
|
||||
statements). (Nikita)
|
||||
. Fixed bug #78152 (PDO::exec() - Bad error handling with multiple commands).
|
||||
(Nikita)
|
||||
. Fixed bug #70066 (Unexpected "Cannot execute queries while other unbuffered
|
||||
queries"). (Nikita)
|
||||
. Fixed bug #71145 (Multiple statements in init command triggers unbuffered
|
||||
query error). (Nikita)
|
||||
. Fixed bug #76815 (PDOStatement cannot be GCed/closeCursor-ed when a
|
||||
PROCEDURE resultset SIGNAL). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
|
||||
(CVE-2020-7071) (cmb)
|
||||
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
|
||||
. Fixed bug #80411 (References to null-serialized object break serialize()).
|
||||
(Nikita)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
|
||||
|
||||
- Zlib:
|
||||
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
|
||||
|
||||
26 Nov 2020, PHP 7.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
|
||||
(cmb)
|
||||
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
|
||||
(cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
|
||||
(cmb, Dmitry, Nikita)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
|
||||
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
|
||||
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
|
||||
. Fixed minor regression caused by fixing bug #80220. (cmb)
|
||||
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #79375 (mysqli_store_result does not report error from lock wait
|
||||
timeout). (Kamil Tekiela, Nikita)
|
||||
. Fixed bug #76525 (mysqli::commit does not throw if MYSQLI_REPORT_ERROR
|
||||
enabled and mysqlnd used). (Kamil Tekiela)
|
||||
. Fixed bug #72413 (mysqlnd segfault (fetch_row second parameter
|
||||
typemismatch)). (Kamil Tekiela)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79643 (PHP with Opcache crashes when a file with specific name
|
||||
is included). (twosee)
|
||||
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79983 (openssl_encrypt / openssl_decrypt fail with OCB mode).
|
||||
(Nikita)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #66528 (No PDOException or errorCode if database becomes
|
||||
unavailable before PDO::commit). (Nikita)
|
||||
. Fixed bug #65825 (PDOStatement::fetch() does not throw exception on broken
|
||||
server connection). (Nikita)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
|
||||
(Alexander Bergmann, cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
|
||||
|
||||
29 Oct 2020, PHP 7.4.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80061 (Copying large files may have suboptimal performance).
|
||||
(cmb)
|
||||
. Fixed bug #79423 (copy command is limited to size of file it can copy).
|
||||
(cmb)
|
||||
. Fixed bug #80126 (Covariant return types failing compilation). (Nikita)
|
||||
. Fixed bug #80186 (Segfault when iterating over FFI object). (Nikita)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80185 (jdtounix() fails after 2037). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
|
||||
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
|
||||
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
|
||||
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
|
||||
(cmb)
|
||||
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
|
||||
(cmb)
|
||||
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
|
||||
slashes). (cmb)
|
||||
. Fixed bug #80107 (mysqli_query() fails for ~16 MB long query when
|
||||
compression is enabled). (Nikita)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #78470 (odbc_specialcolumns() no longer accepts $nullable). (cmb)
|
||||
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
|
||||
(cmb)
|
||||
. Fixed bug #80150 (Failure to fetch error message). (cmb)
|
||||
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
|
||||
. Fixed bug #46050 (odbc_next_result corrupts prepared resource). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data
|
||||
binding). (Nikita)
|
||||
. Fixed bug #80194 (Assertion failure during block assembly of unreachable
|
||||
free with leading nop). (Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Updated to PCRE 10.35. (cmb)
|
||||
. Fixed bug #80118 (Erroneous whitespace match with JIT only). (cmb)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #67465 (NULL Pointer dereference in odbc_handle_preparer). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80114 (parse_url does not accept URLs with port 0). (cmb, twosee)
|
||||
. Fixed bug #76943 (Inconsistent stream_wrapper_restore() errors). (cmb)
|
||||
. Fixed bug #76735 (Incorrect message in fopen on invalid mode). (cmb)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77040 (tidyNode::isHtml() is completely broken). (cmb)
|
||||
|
||||
01 Oct 2020, PHP 7.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79699 (PHP parses encoded cookie names so malicious `__Host-`
|
||||
cookies can be sent). (CVE-2020-7070) (Stas)
|
||||
. Fixed bug #79979 (passing value to by-ref param via CUFA crashes). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #80037 (Typed property must not be accessed before initialization
|
||||
@@ -12,6 +221,8 @@ PHP NEWS
|
||||
. Fixed bug #80048 (Bug #69100 has not been fixed for Windows). (cmb)
|
||||
. Fixed bug #80049 (Memleak when coercing integers to string via variadic
|
||||
argument). (Nikita)
|
||||
. Fixed bug #79699 (PHP parses encoded cookie names so malicious `__Host-`
|
||||
cookies can be sent). (CVE-2020-7070) (Stas)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
|
||||
@@ -29,12 +240,16 @@ PHP NEWS
|
||||
handlers changed). (SammyK)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12
|
||||
. Fixed bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12
|
||||
bytes IV). (CVE-2020-7069) (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
|
||||
many bind parameters (Matteo)
|
||||
many bind parameters). (Matteo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79986 (str_ireplace bug with diacritics characters). (cmb)
|
||||
@@ -86,10 +301,6 @@ PHP NEWS
|
||||
. Fixed bug #79724 (Return type does not match in ext/session/mod_mm.c).
|
||||
(Nikita)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
|
||||
with single reference). (Nikita)
|
||||
|
||||
@@ -126,8 +126,8 @@ DOM:
|
||||
The new signature is also (LSP) compatible with older PHP versions.
|
||||
|
||||
- SAPI:
|
||||
. Starting with 7.4.11, incoming cookie names are not url-decoded. This was never
|
||||
required by the standard, outgoing cookie names aren't encoded and this leads
|
||||
. Starting with 7.4.11, incoming cookie names are not url-decoded. This was never
|
||||
required by the standard, outgoing cookie names aren't encoded and this leads
|
||||
to security issues (CVE-2020-7070).
|
||||
|
||||
- SPL:
|
||||
|
||||
+4
-4
@@ -164,16 +164,16 @@ int main()
|
||||
double d = (double) LONG_MIN * LONG_MIN + 2e9;
|
||||
|
||||
if ((long) d == 2e9 && (long) -d == -2e9) {
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
} else if (sizeof(long) == 8) {
|
||||
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
|
||||
|
||||
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
@@ -284,7 +284,7 @@ int main()
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Array addition should not add INDIRECT elements
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = 1;
|
||||
$ary = ['y' => 1];
|
||||
$ary += $GLOBALS;
|
||||
var_dump($ary['x']);
|
||||
$x = 2;
|
||||
var_dump($ary['x']);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Add $GLOBALS to itself
|
||||
--FILE--
|
||||
<?php
|
||||
$GLOBALS += $GLOBALS;
|
||||
$x = $GLOBALS + $GLOBALS;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created from function in %s on line %d
|
||||
@@ -18,5 +18,5 @@ var_dump($c);
|
||||
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created from method in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I { }
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
class C2 extends C {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I {
|
||||
return new static();
|
||||
}
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
interface I2 { }
|
||||
|
||||
class C2 extends C implements I2 {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #80194: Assertion failure during block assembly of unreachable free with leading nop
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($x) {
|
||||
switch ($x->y) {
|
||||
default:
|
||||
throw new Exception;
|
||||
case 'foobar':
|
||||
return new stdClass();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$x = (object)['y' => 'foobar'];
|
||||
var_dump(test($x));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
+12
-12
@@ -118,10 +118,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -139,10 +139,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -163,13 +163,13 @@ bindTo(new Cls, Cls::class):
|
||||
Cannot bind an instance to a static closure
|
||||
|
||||
bindTo(null, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(null, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(null, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(new Cls)->method()
|
||||
-------------------
|
||||
@@ -189,13 +189,13 @@ bindTo(new ClsUnrelated, Cls::class):
|
||||
Cannot bind method Cls::method() to object of class ClsUnrelated
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new Cls, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new Cls, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(new SplDoublyLinkedList)->count()
|
||||
----------------------------------
|
||||
@@ -216,10 +216,10 @@ bindTo(null, SplDoublyLinkedList::class):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Make sure type inference upholds invariants for dead arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
foreach ($a as $v) {
|
||||
$b[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
GC on running generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
// Trigger GC while $v is being reassigned.
|
||||
$ary = [new stdClass, new stdClass, new stdClass];
|
||||
$ary[0]->foo = $ary;
|
||||
foreach ($ary as &$v) { }
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
// Make sure gen is registered as a GC root.
|
||||
$gen = gen();
|
||||
$gen2 = $gen;
|
||||
unset($gen);
|
||||
foreach ($gen2 as $v) {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Missing live range if part of phi
|
||||
--FILE--
|
||||
<?php
|
||||
function doThrow() {
|
||||
throw new Exception("Test");
|
||||
}
|
||||
function test($k) {
|
||||
// The 0 gives the QM_ASSIGN a non-refcounted type.
|
||||
$res[$k ? $k : 0] = doThrow();
|
||||
}
|
||||
try {
|
||||
test(new stdClass);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Test property guard hash value assumption
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
function __get($var) {
|
||||
return $this->{$var.''};
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
var_dump($test->x);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Test::$x in %s on line %d
|
||||
NULL
|
||||
+3
-1
@@ -1309,7 +1309,9 @@ static ZEND_COLD void zend_error_va_list(
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
va_copy(usr_copy, args);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, usr_copy);
|
||||
va_end(usr_copy);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,11 @@ static zend_bool zend_valid_closure_binding(
|
||||
}
|
||||
|
||||
if (is_fake_closure && scope != func->common.scope) {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
|
||||
if (func->common.scope == NULL) {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created from function");
|
||||
} else {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created from method");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -1050,7 +1050,12 @@ ZEND_API int do_bind_function(zval *lcname) /* {{{ */
|
||||
return FAILURE;
|
||||
}
|
||||
function = (zend_function*)Z_PTR_P(zv);
|
||||
zv = zend_hash_set_bucket_key(EG(function_table), (Bucket*)zv, Z_STR_P(lcname));
|
||||
if (UNEXPECTED(function->common.fn_flags & ZEND_ACC_PRELOADED)
|
||||
&& !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)) {
|
||||
zv = zend_hash_add(EG(function_table), Z_STR_P(lcname), zv);
|
||||
} else {
|
||||
zv = zend_hash_set_bucket_key(EG(function_table), (Bucket*)zv, Z_STR_P(lcname));
|
||||
}
|
||||
if (UNEXPECTED(!zv)) {
|
||||
do_bind_function_error(Z_STR_P(lcname), &function->op_array, 0);
|
||||
return FAILURE;
|
||||
|
||||
@@ -73,6 +73,44 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
/* Function based on compiler-rt implementation. */
|
||||
static unsigned get_xcr0_eax() {
|
||||
# if defined(__GNUC__) || defined(__clang__)
|
||||
// Check xgetbv; this uses a .byte sequence instead of the instruction
|
||||
// directly because older assemblers do not include support for xgetbv and
|
||||
// there is no easy way to conditionally compile based on the assembler used.
|
||||
unsigned eax, edx;
|
||||
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0));
|
||||
return eax;
|
||||
# elif defined(ZEND_WIN32) && defined(_XCR_XFEATURE_ENABLED_MASK)
|
||||
return _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
|
||||
# else
|
||||
return 0;
|
||||
# endif
|
||||
}
|
||||
|
||||
static zend_bool is_avx_supported() {
|
||||
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) {
|
||||
/* No support for AVX */
|
||||
return 0;
|
||||
}
|
||||
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_OSXSAVE)) {
|
||||
/* The operating system does not support XSAVE. */
|
||||
return 0;
|
||||
}
|
||||
if ((get_xcr0_eax() & 0x6) != 0x6) {
|
||||
/* XCR0 SSE and AVX bits must be set. */
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
static zend_bool is_avx_supported() {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void zend_cpu_startup(void)
|
||||
{
|
||||
if (!cpuinfo.initialized) {
|
||||
@@ -95,6 +133,11 @@ void zend_cpu_startup(void)
|
||||
} else {
|
||||
cpuinfo.ebx = 0;
|
||||
}
|
||||
|
||||
if (!is_avx_supported()) {
|
||||
cpuinfo.edx &= ~ZEND_CPU_FEATURE_AVX;
|
||||
cpuinfo.ebx &= ~(ZEND_CPU_FEATURE_AVX2 & ~ZEND_CPU_EBX_MASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1294,7 +1294,7 @@ static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
setitimer(ITIMER_REAL, &t_r, NULL);
|
||||
}
|
||||
signo = SIGALRM;
|
||||
@@ -1356,7 +1356,7 @@ void zend_unset_timeout(void) /* {{{ */
|
||||
|
||||
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
setitimer(ITIMER_REAL, &no_timeout, NULL);
|
||||
# else
|
||||
setitimer(ITIMER_PROF, &no_timeout, NULL);
|
||||
|
||||
@@ -340,6 +340,16 @@ static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
/* If the generator is currently running, we certainly won't be able to GC any values it
|
||||
* holds on to. The execute_data state might be inconsistent during execution (e.g. because
|
||||
* GC has been triggered in the middle of a variable reassignment), so we should not try
|
||||
* to inspect it here. */
|
||||
*table = NULL;
|
||||
*n = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
op_array = &EX(func)->op_array;
|
||||
gc_buffer_size = calc_gc_buffer_size(generator);
|
||||
if (generator->gc_buffer_size < gc_buffer_size) {
|
||||
|
||||
+17
-13
@@ -2124,7 +2124,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
{
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
zval *t;
|
||||
zval *t, *s;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
@@ -2133,18 +2133,20 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
if (overwrite) {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_update(target, p->h, &p->val);
|
||||
t = zend_hash_index_update(target, p->h, s);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
@@ -2153,18 +2155,20 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
} else {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_add(target, p->h, &p->val);
|
||||
t = zend_hash_index_add(target, p->h, s);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
|
||||
+10
-12
@@ -259,8 +259,6 @@ static zend_class_entry *lookup_class(zend_class_entry *scope, zend_string *name
|
||||
|
||||
/* Instanceof that's safe to use on unlinked classes. */
|
||||
static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
|
||||
zend_class_entry *ce;
|
||||
|
||||
if (ce1 == ce2) {
|
||||
return 1;
|
||||
}
|
||||
@@ -269,18 +267,18 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
|
||||
return instanceof_function(ce1, ce2);
|
||||
}
|
||||
|
||||
ce = ce1;
|
||||
while (ce->parent) {
|
||||
if (ce->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
|
||||
ce = ce->parent;
|
||||
if (ce1->parent) {
|
||||
zend_class_entry *parent_ce;
|
||||
if (ce1->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
|
||||
parent_ce = ce1->parent;
|
||||
} else {
|
||||
ce = zend_lookup_class_ex(ce->parent_name, NULL,
|
||||
parent_ce = zend_lookup_class_ex(ce1->parent_name, NULL,
|
||||
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
||||
if (!ce) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ce == ce2) {
|
||||
|
||||
/* It's not sufficient to only check the parent chain itself, as need to do a full
|
||||
* recursive instanceof in case the parent interfaces haven't been copied yet. */
|
||||
if (parent_ce && unlinked_instanceof(parent_ce, ce2)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -297,7 +295,7 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < ce1->num_interfaces; i++) {
|
||||
ce = zend_lookup_class_ex(
|
||||
zend_class_entry *ce = zend_lookup_class_ex(
|
||||
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
|
||||
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
||||
if (ce && unlinked_instanceof(ce, ce2)) {
|
||||
|
||||
@@ -177,7 +177,7 @@ static void yy_pop_state(void)
|
||||
zend_stack_del_top(&SCNG(state_stack));
|
||||
}
|
||||
|
||||
static void yy_scan_buffer(char *str, unsigned int len)
|
||||
static void yy_scan_buffer(char *str, size_t len)
|
||||
{
|
||||
YYCURSOR = (YYCTYPE*)str;
|
||||
YYLIMIT = YYCURSOR + len;
|
||||
@@ -554,7 +554,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle)
|
||||
}
|
||||
}
|
||||
SCNG(yy_start) = (unsigned char *)buf;
|
||||
yy_scan_buffer(buf, (unsigned int)size);
|
||||
yy_scan_buffer(buf, size);
|
||||
} else {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
|
||||
}
|
||||
@@ -722,7 +722,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
yy_scan_buffer(buf, (unsigned int)size);
|
||||
yy_scan_buffer(buf, size);
|
||||
|
||||
new_compiled_filename = zend_string_init(filename, strlen(filename), 0);
|
||||
zend_set_compiled_filename(new_compiled_filename);
|
||||
|
||||
@@ -619,8 +619,8 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
|
||||
if (EXPECTED(Z_TYPE_P(zv) == IS_STRING)) {
|
||||
zend_string *str = Z_STR_P(zv);
|
||||
if (EXPECTED(str == member) ||
|
||||
/* hash values are always pred-calculated here */
|
||||
(EXPECTED(ZSTR_H(str) == ZSTR_H(member)) &&
|
||||
/* "str" always has a pre-calculated hash value here */
|
||||
(EXPECTED(ZSTR_H(str) == zend_string_hash_val(member)) &&
|
||||
EXPECTED(zend_string_equal_content(str, member)))) {
|
||||
return &Z_PROPERTY_GUARD_P(zv);
|
||||
} else if (EXPECTED(Z_PROPERTY_GUARD_P(zv) == 0)) {
|
||||
|
||||
@@ -934,7 +934,7 @@ ZEND_API zend_string* ZEND_FASTCALL zval_try_get_string_func(zval *op) /* {{{ */
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
if ((result == op1) && (result == op2)) {
|
||||
if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) {
|
||||
/* $a += $a */
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-1
@@ -62,7 +62,8 @@ ZEND_API zend_signal_globals_t zend_signal_globals;
|
||||
static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
|
||||
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#if defined(__CYGWIN__) || defined(__PASE__)
|
||||
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
|
||||
#define TIMEOUT_SIG SIGALRM
|
||||
#else
|
||||
#define TIMEOUT_SIG SIGPROF
|
||||
|
||||
@@ -498,6 +498,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
HANDLE hFind = INVALID_HANDLE_VALUE;
|
||||
ALLOCA_FLAG(use_heap_large)
|
||||
wchar_t *pathw = NULL;
|
||||
int may_retry_reparse_point;
|
||||
#define FREE_PATHW() \
|
||||
do { free(pathw); } while(0);
|
||||
|
||||
@@ -597,6 +598,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
retry_reparse_point:
|
||||
may_retry_reparse_point = 0;
|
||||
if (save) {
|
||||
pathw = php_win32_ioutil_any_to_w(path);
|
||||
if (!pathw) {
|
||||
@@ -691,6 +693,7 @@ retry_reparse_tag_cloud:
|
||||
CloseHandle(hLink);
|
||||
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
may_retry_reparse_point = 1;
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
isabsolute = pbuffer->SymbolicLinkReparseBuffer.Flags == 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
@@ -827,7 +830,7 @@ retry_reparse_tag_cloud:
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free(substitutename);
|
||||
|
||||
{
|
||||
if (may_retry_reparse_point) {
|
||||
DWORD attrs;
|
||||
|
||||
FREE_PATHW()
|
||||
|
||||
+24
-7
@@ -6317,11 +6317,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (OP1_TYPE != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
HashTable *properties;
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -6329,8 +6325,21 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (OP1_TYPE != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
FREE_OP1_IF_VAR();
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
FREE_OP1_IF_VAR();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -6397,6 +6406,7 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -6415,8 +6425,15 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
FREE_OP1_VAR_PTR();
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
FREE_OP1_VAR_PTR();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
|
||||
+102
-28
@@ -4140,11 +4140,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_CONST != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
HashTable *properties;
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -4152,7 +4148,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_CONST != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -4218,6 +4228,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -4236,7 +4247,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -18192,11 +18211,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_TMP_VAR != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
HashTable *properties;
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -18204,7 +18219,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_TMP_VAR != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -18271,6 +18300,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_TMP_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -18289,7 +18319,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -21282,11 +21320,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_VAR != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
HashTable *properties;
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -21294,8 +21328,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_VAR != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -21362,6 +21409,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_VAR != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -21380,8 +21428,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -37792,11 +37847,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_CV != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
HashTable *properties;
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -37804,7 +37855,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (IS_CV != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -37870,6 +37935,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -37888,7 +37954,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,14 @@ trigger:
|
||||
- UPGRADING
|
||||
- UPGRADING.INTERNALS
|
||||
|
||||
schedules:
|
||||
- cron: "0 1 * * *"
|
||||
displayName: Nightly build
|
||||
branches:
|
||||
include:
|
||||
- PHP-7.4
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- template: azure/job.yml
|
||||
parameters:
|
||||
|
||||
+10
-1
@@ -59,7 +59,7 @@ jobs:
|
||||
php vendor/bin/phpunit
|
||||
displayName: 'Test Laravel'
|
||||
- script: |
|
||||
git clone https://github.com/symfony/symfony.git --branch=master --depth=1
|
||||
git clone https://github.com/symfony/symfony.git --depth=1
|
||||
cd symfony
|
||||
php7.3 /usr/bin/composer install --no-progress
|
||||
php7.3 ./phpunit install
|
||||
@@ -81,3 +81,12 @@ jobs:
|
||||
php vendor/bin/phpunit
|
||||
displayName: 'Test Amphp'
|
||||
condition: or(succeeded(), failed())
|
||||
- script: |
|
||||
php7.3 /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress
|
||||
cd symfony_demo
|
||||
export USE_ZEND_ALLOC=0
|
||||
export USE_TRACKED_ALLOC=1
|
||||
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
|
||||
php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
|
||||
displayName: 'Symfony Preloading'
|
||||
condition: or(succeeded(), failed())
|
||||
@@ -32,10 +32,13 @@ jobs:
|
||||
runTestsParameters: >-
|
||||
${{ parameters.runTestsParameters }}
|
||||
-d zend_extension=opcache.so
|
||||
- script: bash <(curl -s https://codecov.io/bash)
|
||||
displayName: 'Upload ${{ parameters.configurationName }} Test Coverage to Codecov.io'
|
||||
condition: or(succeeded(), failed())
|
||||
- script: |
|
||||
make gcovr-xml
|
||||
mv gcovr.xml coverage.xml
|
||||
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage'
|
||||
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage Cobertura XML Report'
|
||||
condition: or(succeeded(), failed())
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
|
||||
Vendored
+4
-8
@@ -340,7 +340,7 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
|
||||
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
|
||||
10.[[012]]*)
|
||||
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
|
||||
10.*)
|
||||
*)
|
||||
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
@@ -978,10 +978,6 @@ else
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" void exit (int);
|
||||
#endif
|
||||
|
||||
void fnord() { int i=42;}
|
||||
int main ()
|
||||
{
|
||||
@@ -997,7 +993,7 @@ int main ()
|
||||
else
|
||||
puts (dlerror ());
|
||||
|
||||
exit (status);
|
||||
return (status);
|
||||
}]
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
|
||||
@@ -1525,7 +1521,7 @@ darwin* | rhapsody*)
|
||||
shlibpath_var=DYLD_LIBRARY_PATH
|
||||
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
|
||||
ifelse([$1], [],[
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
|
||||
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
|
||||
;;
|
||||
|
||||
@@ -5803,7 +5799,7 @@ _LT_EOF
|
||||
10.[[012]])
|
||||
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
|
||||
;;
|
||||
10.*)
|
||||
*)
|
||||
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
|
||||
;;
|
||||
esac
|
||||
|
||||
+22
-14
@@ -498,7 +498,7 @@ dnl Internal, don't use.
|
||||
dnl
|
||||
AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[
|
||||
case $1 in
|
||||
c|c_r|pthread*[)] ;;
|
||||
c|c_r[)] ;;
|
||||
*[)] ifelse($3,,[
|
||||
_PHP_X_ADD_LIBRARY($1,$2,$5)
|
||||
],[
|
||||
@@ -1176,14 +1176,14 @@ AC_DEFUN([PHP_DOES_PWRITE_WORK],[
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
|
||||
|
||||
if (fd < 0) exit(1);
|
||||
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pwrite(fd, "text", 4, 0) != 4) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
]])],[
|
||||
@@ -1209,14 +1209,14 @@ AC_DEFUN([PHP_DOES_PREAD_WORK],[
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
char buf[3];
|
||||
int fd = open("conftest_in", O_RDONLY);
|
||||
if (fd < 0) exit(1);
|
||||
if (pread(fd, buf, 2, 0) != 2) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pread(fd, buf, 2, 0) != 2) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
]])],[
|
||||
ac_cv_pread=yes
|
||||
@@ -1478,13 +1478,13 @@ int seeker(void *cookie, off64_t *position, int whence)
|
||||
|
||||
cookie_io_functions_t funcs = {reader, writer, seeker, closer};
|
||||
|
||||
main() {
|
||||
int main() {
|
||||
struct cookiedata g = { 0 };
|
||||
FILE *fp = fopencookie(&g, "r", funcs);
|
||||
|
||||
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
|
||||
exit(0);
|
||||
exit(1);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
]])], [
|
||||
@@ -1783,6 +1783,9 @@ AC_DEFUN([PHP_PROG_BISON], [
|
||||
AC_MSG_CHECKING([for bison version])
|
||||
|
||||
php_bison_version=$($YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | tr -d a-z)
|
||||
if test -z "$php_bison_version"; then
|
||||
php_bison_version=0.0.0
|
||||
fi
|
||||
ac_IFS=$IFS; IFS="."
|
||||
set $php_bison_version
|
||||
IFS=$ac_IFS
|
||||
@@ -1846,6 +1849,9 @@ AC_DEFUN([PHP_PROG_RE2C],[
|
||||
AC_MSG_CHECKING([for re2c version])
|
||||
|
||||
php_re2c_version=$($RE2C --version | cut -d ' ' -f 2 2>/dev/null)
|
||||
if test -z "$php_re2c_version"; then
|
||||
php_re2c_version=0.0.0
|
||||
fi
|
||||
ac_IFS=$IFS; IFS="."
|
||||
set $php_re2c_version
|
||||
IFS=$ac_IFS
|
||||
@@ -1907,6 +1913,8 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
if test "$PKG_CONFIG icu-io --atleast-version=60"; then
|
||||
ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
|
||||
fi
|
||||
|
||||
ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1"
|
||||
])
|
||||
|
||||
dnl
|
||||
|
||||
+7
-6
@@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice.
|
||||
dnl ----------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT([PHP],[7.4.11],[https://bugs.php.net],[php],[https://www.php.net])
|
||||
AC_INIT([PHP],[7.4.15],[https://bugs.php.net],[php],[https://www.php.net])
|
||||
AC_CONFIG_SRCDIR([main/php_version.h])
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
AC_PRESERVE_HELP_ORDER
|
||||
@@ -662,6 +662,7 @@ dnl getaddrinfo.
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
|
||||
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef AF_INET
|
||||
@@ -674,11 +675,11 @@ int main(void) {
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
|
||||
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ai == 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pai = ai;
|
||||
@@ -686,16 +687,16 @@ int main(void) {
|
||||
while (pai) {
|
||||
if (pai->ai_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if (pai->ai_addr->sa_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
pai = pai->ai_next;
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
|
||||
[ac_cv_func_getaddrinfo=no])])
|
||||
|
||||
@@ -83,12 +83,12 @@ bool(false)
|
||||
resource(%d) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
|
||||
Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
|
||||
Warning: fopen(bz_open_002.txt): failed to open stream: `br' is not a valid mode for fopen in %s on line %d
|
||||
|
||||
Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
|
||||
Warning: fopen(bz_open_002.txt): failed to open stream: `br' is not a valid mode for fopen in %s on line %d
|
||||
|
||||
Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "sdncal.h"
|
||||
#include <time.h>
|
||||
|
||||
#define SECS_PER_DAY (24 * 3600)
|
||||
|
||||
/* {{{ proto int unixtojd([int timestamp])
|
||||
Convert UNIX timestamp to Julian Day */
|
||||
PHP_FUNCTION(unixtojd)
|
||||
@@ -62,10 +64,10 @@ PHP_FUNCTION(jdtounix)
|
||||
}
|
||||
uday -= 2440588 /* J.D. of 1.1.1970 */;
|
||||
|
||||
if (uday < 0 || uday > 24755) { /* before beginning of unix epoch or behind end of unix epoch */
|
||||
if (uday < 0 || uday > ZEND_LONG_MAX / SECS_PER_DAY) { /* before beginning of unix epoch or greater than representable */
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_LONG(uday * 24 * 3600);
|
||||
RETURN_LONG(uday * SECS_PER_DAY);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80185 (jdtounix() fails after 2037)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
if (PHP_INT_SIZE != 8) die("skip for 64bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(jdtounix(2465712));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2170713600)
|
||||
int(9223372036854720000)
|
||||
bool(false)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80185 (jdtounix() fails after 2037)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(jdtounix(2465712));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(2147472000)
|
||||
bool(false)
|
||||
@@ -311,18 +311,20 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
|
||||
|
||||
if (obj) {
|
||||
if (dispname == NULL && sink) {
|
||||
IProvideClassInfo2 *pci2;
|
||||
IProvideClassInfo *pci;
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
IProvideClassInfo2 *pci2;
|
||||
IProvideClassInfo *pci;
|
||||
|
||||
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
|
||||
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
|
||||
IProvideClassInfo2_Release(pci2);
|
||||
}
|
||||
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
|
||||
/* examine the available interfaces */
|
||||
/* TODO: write some code here */
|
||||
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
|
||||
IProvideClassInfo_Release(pci);
|
||||
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
|
||||
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
|
||||
IProvideClassInfo2_Release(pci2);
|
||||
}
|
||||
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
|
||||
/* examine the available interfaces */
|
||||
/* TODO: write some code here */
|
||||
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
|
||||
IProvideClassInfo_Release(pci);
|
||||
}
|
||||
}
|
||||
} else if (dispname == NULL) {
|
||||
if (obj->typeinfo) {
|
||||
@@ -339,15 +341,17 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(obj->typeinfo, &typelib, &idx);
|
||||
} else if (typelibname == NULL) {
|
||||
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
|
||||
if (dispname) {
|
||||
unsigned int idx;
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
|
||||
if (dispname) {
|
||||
unsigned int idx;
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
|
||||
|
||||
if (typelib) {
|
||||
ITypeInfo_Release(typeinfo);
|
||||
typeinfo = NULL;
|
||||
if (typelib) {
|
||||
ITypeInfo_Release(typeinfo);
|
||||
typeinfo = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #62474 (com_event_sink crashes on certain arguments)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(com_event_sink(new variant, function() {}, array()));
|
||||
var_dump(com_event_sink(new variant, new variant, 'a'));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -2969,7 +2969,14 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
|
||||
case CURLOPT_POSTFIELDS:
|
||||
if (Z_TYPE_P(zvalue) == IS_ARRAY || Z_TYPE_P(zvalue) == IS_OBJECT) {
|
||||
return build_mime_structure_from_hash(ch, zvalue);
|
||||
if (zend_hash_num_elements(HASH_OF(zvalue)) == 0) {
|
||||
/* no need to build the mime structure for empty hashtables;
|
||||
also works around https://github.com/curl/curl/issues/6455 */
|
||||
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, "");
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, 0);
|
||||
} else {
|
||||
return build_mime_structure_from_hash(ch, zvalue);
|
||||
}
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071101
|
||||
zend_string *tmp_str;
|
||||
|
||||
@@ -21,9 +21,10 @@ var_dump(curl_getinfo($ch)["request_header"]);
|
||||
string(%d) "array(0) {
|
||||
}
|
||||
"
|
||||
string(90) "POST /get.inc?test=post HTTP/1.1
|
||||
string(%d) "POST /get.inc?test=post HTTP/1.1
|
||||
Host: localhost:%d
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
"
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #80595 (Resetting POSTFIELDS to empty array breaks request)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_URL => "{$host}/get.inc?test=post",
|
||||
]);
|
||||
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, ['foo' => 'bar']);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, []);
|
||||
var_dump(curl_exec($ch));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(43) "array(1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
"
|
||||
string(13) "array(0) {
|
||||
}
|
||||
"
|
||||
@@ -7,7 +7,7 @@ TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url = uniqid()."://www.".uniqid().".".uniqid();
|
||||
$url = substr(uniqid(),0,7)."://www.".uniqid().".".uniqid();
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
@@ -18,6 +18,6 @@ curl_close($ch);
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
string\(\d+\) "([^\r\n]*rotocol[^\r\n]+|Could not resolve host: .+)"
|
||||
int\(\d\)
|
||||
--EXPECTF--
|
||||
string(%d) "%Srotocol%s"
|
||||
int(1)
|
||||
@@ -1,6 +1,7 @@
|
||||
// vim:ft=javascript
|
||||
|
||||
EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_TIMELIB_CONFIG_H=1");
|
||||
PHP_DATE = "yes";
|
||||
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
|
||||
|
||||
ADD_FLAG('CFLAGS_DATE', "/wd4244");
|
||||
|
||||
+22837
-20045
File diff suppressed because it is too large.
Load diff
+395
-432
File diff suppressed because it is too large.
Load diff
+795
-923
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,7 @@ Bug #48097 (date_timezone_set function produces wrong datetime result)
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$d = date_create( "Mon, 23 May 1955 00:00:00 +0200" );
|
||||
$d = date_create( "Sun, 22 May 1955 02:00:00 +0200" );
|
||||
var_dump( $d );
|
||||
echo $d->format( DATE_ISO8601 ), "\n";
|
||||
echo $d->format( 'U' ), "\n\n";
|
||||
@@ -16,23 +16,23 @@ echo $d->format( 'U' ), "\n\n";
|
||||
--EXPECT--
|
||||
object(DateTime)#1 (3) {
|
||||
["date"]=>
|
||||
string(26) "1955-05-23 00:00:00.000000"
|
||||
string(26) "1955-05-22 02:00:00.000000"
|
||||
["timezone_type"]=>
|
||||
int(1)
|
||||
["timezone"]=>
|
||||
string(6) "+02:00"
|
||||
}
|
||||
1955-05-23T00:00:00+0200
|
||||
-461124000
|
||||
1955-05-22T02:00:00+0200
|
||||
-461203200
|
||||
|
||||
object(DateTime)#1 (3) {
|
||||
["date"]=>
|
||||
string(26) "1955-05-22 23:00:00.000000"
|
||||
string(26) "1955-05-22 01:00:00.000000"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(15) "Europe/Budapest"
|
||||
}
|
||||
1955-05-22T23:00:00+0100
|
||||
1955-05-22T01:00:00+0100
|
||||
|
||||
-461124000
|
||||
-461203200
|
||||
@@ -2050,7 +2050,6 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
}
|
||||
ctxt = htmlCreateFileParserCtxt(source, NULL);
|
||||
} else {
|
||||
source_len = xmlStrlen((xmlChar *) source);
|
||||
if (ZEND_SIZE_T_INT_OVFL(source_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Input string is too long");
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #80268 (loadHTML() truncates at NUL bytes)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument;
|
||||
$doc->loadHTML("<p>foo\0bar</p>");
|
||||
$html = $doc->saveHTML();
|
||||
var_dump(strpos($html, '<p>foo</p>') !== false);
|
||||
|
||||
file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
|
||||
$doc = new DOMDocument;
|
||||
$doc->loadHTMLFile(__DIR__ . '/80268.html');
|
||||
$html = $doc->saveHTML();
|
||||
var_dump(strpos($html, '<p>foo</p>') !== false);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/80268.html');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
+15
-9
@@ -886,6 +886,10 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v
|
||||
}
|
||||
free_alloca(fci.params, use_heap);
|
||||
|
||||
if (EG(exception)) {
|
||||
zend_error(E_ERROR, "Throwing from FFI callbacks is not allowed");
|
||||
}
|
||||
|
||||
ret_type = ZEND_FFI_TYPE(callback_data->type->func.ret_type);
|
||||
if (ret_type->kind != ZEND_FFI_TYPE_VOID) {
|
||||
zend_ffi_zval_to_cdata(ret, ret_type, &retval);
|
||||
@@ -7427,11 +7431,11 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
|
||||
val->ch = '\t';
|
||||
} else if (str[2] == 'v' && str_len == 4) {
|
||||
val->ch = '\v';
|
||||
} else if (str[2] >= '0' || str[2] <= '7') {
|
||||
} else if (str[2] >= '0' && str[2] <= '7') {
|
||||
n = str[2] - '0';
|
||||
if (str[3] >= '0' || str[3] <= '7') {
|
||||
if (str[3] >= '0' && str[3] <= '7') {
|
||||
n = n * 8 + (str[3] - '0');
|
||||
if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) {
|
||||
if ((str[4] >= '0' && str[4] <= '7') && str_len == 6) {
|
||||
n = n * 8 + (str[4] - '0');
|
||||
} else if (str_len != 5) {
|
||||
val->kind = ZEND_FFI_VAL_ERROR;
|
||||
@@ -7445,23 +7449,25 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
|
||||
val->kind = ZEND_FFI_VAL_ERROR;
|
||||
}
|
||||
} else if (str[2] == 'x') {
|
||||
if (str[3] >= '0' || str[3] <= '7') {
|
||||
if (str[3] >= '0' && str[3] <= '9') {
|
||||
n = str[3] - '0';
|
||||
} else if (str[3] >= 'A' || str[3] <= 'F') {
|
||||
} else if (str[3] >= 'A' && str[3] <= 'F') {
|
||||
n = str[3] - 'A';
|
||||
} else if (str[3] >= 'a' || str[3] <= 'f') {
|
||||
} else if (str[3] >= 'a' && str[3] <= 'f') {
|
||||
n = str[3] - 'a';
|
||||
} else {
|
||||
val->kind = ZEND_FFI_VAL_ERROR;
|
||||
return;
|
||||
}
|
||||
if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) {
|
||||
if ((str[4] >= '0' && str[4] <= '9') && str_len == 6) {
|
||||
n = n * 16 + (str[4] - '0');
|
||||
} else if ((str[4] >= 'A' || str[4] <= 'F') && str_len == 6) {
|
||||
} else if ((str[4] >= 'A' && str[4] <= 'F') && str_len == 6) {
|
||||
n = n * 16 + (str[4] - 'A');
|
||||
} else if ((str[4] >= 'a' || str[4] <= 'f') && str_len == 6) {
|
||||
} else if ((str[4] >= 'a' && str[4] <= 'f') && str_len == 6) {
|
||||
n = n * 16 + (str[4] - 'a');
|
||||
} else if (str_len != 5) {
|
||||
val->kind = ZEND_FFI_VAL_ERROR;
|
||||
return;
|
||||
}
|
||||
val->ch = n;
|
||||
} else if (str_len == 4) {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Bug #79177 (FFI doesn't handle well PHP exceptions within callback)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('ffi')) die('skip ffi extension not available');
|
||||
if (!extension_loaded('zend-test')) die('skip zend-test extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/utils.inc';
|
||||
$header = <<<HEADER
|
||||
extern int *(*bug79177_cb)(void);
|
||||
void bug79177(void);
|
||||
HEADER;
|
||||
|
||||
if (PHP_OS_FAMILY !== 'Windows') {
|
||||
$ffi = FFI::cdef($header);
|
||||
} else {
|
||||
try {
|
||||
$ffi = FFI::cdef($header, 'php_zend_test.dll');
|
||||
} catch (FFI\Exception $ex) {
|
||||
$ffi = FFI::cdef($header, ffi_get_php_dll_name());
|
||||
}
|
||||
}
|
||||
|
||||
$ffi->bug79177_cb = function() {
|
||||
throw new \RuntimeException('Not allowed');
|
||||
};
|
||||
try {
|
||||
$ffi->bug79177(); // this is supposed to raise a fatal error
|
||||
} catch (\Throwable $exception) {}
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Uncaught RuntimeException: Not allowed in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}()
|
||||
#1 %s(%d): FFI->bug79177()
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
Fatal error: Throwing from FFI callbacks is not allowed in %s on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #80186 (Segfault when iterating over FFI object)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('ffi')) die('skip ffi extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ffi = FFI::cdef('typedef int dummy;');
|
||||
foreach ($ffi as $_) { }
|
||||
foreach ($ffi as &$_) { }
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -218,6 +218,7 @@ PHP_MINIT_FUNCTION(finfo)
|
||||
memcpy(&finfo_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
|
||||
finfo_object_handlers.offset = XtOffsetOf(finfo_object, zo);
|
||||
finfo_object_handlers.free_obj = finfo_objects_free;
|
||||
finfo_object_handlers.clone_obj = NULL;
|
||||
|
||||
le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number);
|
||||
|
||||
|
||||
+38
-31
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/apprentice.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/apprentice.c 2020-11-19 11:50:32.412674100 +0100
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -974,7 +974,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/ascmagic.c 2020-02-26 23:18:22.605400700 +0100
|
||||
+++ libmagic/ascmagic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -96,7 +96,7 @@
|
||||
rv = file_ascmagic_with_encoding(ms, &bb,
|
||||
ubuf, ulen, code, type, text);
|
||||
@@ -1005,7 +1005,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
--- libmagic.orig/buffer.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/buffer.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/buffer.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -31,19 +31,23 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -1062,7 +1062,7 @@ diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/cdf.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/cdf.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -1341,7 +1341,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
#endif
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2019-02-20 02:24:19.000000000 +0100
|
||||
+++ libmagic/cdf.h 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/cdf.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -35,10 +35,10 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1366,7 +1366,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
#define CDF_SECID_FREE -1
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/cdf_time.c 2020-02-26 23:18:22.611402900 +0100
|
||||
+++ libmagic/cdf_time.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -23,6 +23,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1395,7 +1395,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/compress.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/compress.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -45,13 +45,11 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
@@ -1545,7 +1545,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif
|
||||
diff -u libmagic.orig/der.c libmagic/der.c
|
||||
--- libmagic.orig/der.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/der.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/der.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -51,7 +51,9 @@
|
||||
#include "magic.h"
|
||||
#include "der.h"
|
||||
@@ -1575,7 +1575,7 @@ diff -u libmagic.orig/der.c libmagic/der.c
|
||||
snprintf(buf + z, blen - z, "%.2x", d[i]);
|
||||
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
--- libmagic.orig/elfclass.h 2019-02-20 02:30:19.000000000 +0100
|
||||
+++ libmagic/elfclass.h 2020-02-26 23:18:22.613401700 +0100
|
||||
+++ libmagic/elfclass.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -41,7 +41,7 @@
|
||||
return toomany(ms, "program headers", phnum);
|
||||
flags |= FLAGS_IS_CORE;
|
||||
@@ -1605,7 +1605,7 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
|
||||
diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
--- libmagic.orig/encoding.c 2019-04-15 18:48:41.000000000 +0200
|
||||
+++ libmagic/encoding.c 2020-02-26 23:18:22.614402300 +0100
|
||||
+++ libmagic/encoding.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -89,13 +89,13 @@
|
||||
*code_mime = "binary";
|
||||
|
||||
@@ -1636,7 +1636,7 @@ diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
}
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/file.h 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/file.h 2020-11-23 17:11:36.234964700 +0100
|
||||
@@ -33,18 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1658,7 +1658,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#ifdef _WIN64
|
||||
#define SIZE_T_FORMAT "I64"
|
||||
#else
|
||||
@@ -57,19 +48,34 @@
|
||||
@@ -57,32 +48,49 @@
|
||||
#define INT64_T_FORMAT "ll"
|
||||
#define INTMAX_T_FORMAT "j"
|
||||
#endif
|
||||
@@ -1698,7 +1698,14 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
/* Do this here and now, because struct stat gets re-defined on solaris */
|
||||
@@ -82,7 +88,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
+#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
|
||||
+
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#ifndef MAGIC
|
||||
#define MAGIC "/etc/magic"
|
||||
#endif
|
||||
|
||||
@@ -1707,7 +1714,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#define PATHSEP ';'
|
||||
#else
|
||||
#define PATHSEP ':'
|
||||
@@ -116,12 +122,6 @@
|
||||
@@ -116,12 +124,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1720,7 +1727,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
@@ -150,10 +150,10 @@
|
||||
@@ -150,10 +152,10 @@
|
||||
|
||||
struct buffer {
|
||||
int fd;
|
||||
@@ -1733,7 +1740,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
void *ebuf;
|
||||
size_t elen;
|
||||
};
|
||||
@@ -243,7 +243,7 @@
|
||||
@@ -243,7 +245,7 @@
|
||||
#define FILE_DER 48
|
||||
#define FILE_NAMES_SIZE 49 /* size of array to contain all names */
|
||||
|
||||
@@ -1742,7 +1749,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
((t) == FILE_STRING || \
|
||||
(t) == FILE_PSTRING || \
|
||||
(t) == FILE_BESTRING16 || \
|
||||
@@ -447,28 +447,23 @@
|
||||
@@ -447,28 +449,23 @@
|
||||
/* Type for Unicode characters */
|
||||
typedef unsigned long unichar;
|
||||
|
||||
@@ -1776,7 +1783,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
protected int file_zmagic(struct magic_set *, const struct buffer *,
|
||||
const char *);
|
||||
#endif
|
||||
@@ -491,13 +486,9 @@
|
||||
@@ -491,13 +488,9 @@
|
||||
protected void file_badread(struct magic_set *);
|
||||
protected void file_badseek(struct magic_set *);
|
||||
protected void file_oomem(struct magic_set *, size_t);
|
||||
@@ -1793,7 +1800,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
protected void file_showstr(FILE *, const char *, size_t);
|
||||
protected size_t file_mbswidth(const char *);
|
||||
protected const char *file_getbuffer(struct magic_set *);
|
||||
@@ -513,34 +504,13 @@
|
||||
@@ -513,34 +506,13 @@
|
||||
size_t);
|
||||
#endif /* __EMX__ */
|
||||
|
||||
@@ -1831,7 +1838,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
typedef struct {
|
||||
char *buf;
|
||||
@@ -550,28 +520,13 @@
|
||||
@@ -550,28 +522,13 @@
|
||||
protected file_pushbuf_t *file_push_buffer(struct magic_set *);
|
||||
protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
|
||||
|
||||
@@ -1862,7 +1869,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
#ifndef HAVE_STRCASESTR
|
||||
@@ -587,39 +542,6 @@
|
||||
@@ -587,39 +544,6 @@
|
||||
#ifndef HAVE_ASCTIME_R
|
||||
char *asctime_r(const struct tm *, char *);
|
||||
#endif
|
||||
@@ -1902,7 +1909,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
|
||||
#define QUICK
|
||||
@@ -645,6 +567,18 @@
|
||||
@@ -645,6 +569,18 @@
|
||||
#else
|
||||
#define FILE_RCSID(id)
|
||||
#endif
|
||||
@@ -1923,7 +1930,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2019-05-07 04:26:48.000000000 +0200
|
||||
+++ libmagic/fsmagic.c 2020-02-26 23:18:22.616403500 +0100
|
||||
+++ libmagic/fsmagic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -66,26 +66,10 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -2216,7 +2223,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
case S_IFSOCK:
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/funcs.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/funcs.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -31,7 +31,6 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -2572,7 +2579,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/magic.c 2020-02-26 23:18:22.621402800 +0100
|
||||
+++ libmagic/magic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -3036,8 +3043,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2020-03-02 15:24:27.253951700 +0100
|
||||
+++ libmagic/magic.h 2020-02-26 23:18:22.622402300 +0100
|
||||
--- libmagic.orig/magic.h 2020-11-23 17:12:12.776465800 +0100
|
||||
+++ libmagic/magic.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -124,6 +124,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -3048,7 +3055,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/print.c 2020-02-26 23:18:22.625401800 +0100
|
||||
+++ libmagic/print.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -28,6 +28,7 @@
|
||||
/*
|
||||
* print.c - debugging printout routines
|
||||
@@ -3122,7 +3129,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
goto out;
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/readcdf.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/readcdf.c 2020-09-07 00:42:14.463191200 +0200
|
||||
@@ -31,7 +31,11 @@
|
||||
|
||||
#include <assert.h>
|
||||
@@ -3241,7 +3248,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if (i != -1)
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2019-05-17 04:24:59.000000000 +0200
|
||||
+++ libmagic/softmagic.c 2020-03-02 15:23:10.176763300 +0100
|
||||
+++ libmagic/softmagic.c 2020-09-07 00:42:14.463191200 +0200
|
||||
@@ -43,6 +43,10 @@
|
||||
#include <time.h>
|
||||
#include "der.h"
|
||||
@@ -3608,7 +3615,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
case FILE_INDIRECT:
|
||||
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
|
||||
--- libmagic.orig/strcasestr.c 2014-09-11 17:05:33.000000000 +0200
|
||||
+++ libmagic/strcasestr.c 2019-11-29 08:49:38.434136600 +0100
|
||||
+++ libmagic/strcasestr.c 2020-08-05 15:01:55.644887300 +0200
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "file.h"
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
|
||||
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#ifndef MAGIC
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
0 string 1
|
||||
>1 regex \^[0-9:,\ ]*-->[0-9:,\ ]* SubRip File
|
||||
!:mime text/x-srt
|
||||
|
||||
0 lelong 0xc3cbc6c5 RISC OS Chunk data
|
||||
>12 string OBJ_ \b, AOF object
|
||||
>12 string LIB_ \b, ALF library
|
||||
|
||||
0 name mach-o \b [
|
||||
>0 use mach-o-cpu \b
|
||||
>(8.L) indirect 8 \b:
|
||||
>0 belong x \b]
|
||||
|
||||
0 belong 0xcafed00d JAR compressed with pack200,
|
||||
>5 byte x version %d.
|
||||
>4 byte x \b%d
|
||||
!:mime application/x-java-pack200
|
||||
|
||||
# Objective-C
|
||||
0 regex \^#import Objective-C source text
|
||||
!:strength + 25
|
||||
!:mime text/x-objective-c
|
||||
|
||||
0 string \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Source:
|
||||
>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Graph:
|
||||
>>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Data: GCOV coverage report
|
||||
|
||||
0 name certinfo
|
||||
>0 der seq
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550406
|
||||
>>>>&0 der prt_str=x \b, countryName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550408
|
||||
>>>>&0 der utf8_str=x \b, stateOrProvinceName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=55040a
|
||||
>>>>&0 der utf8_str=x \b, organizationName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550403
|
||||
>>>>&0 der utf8_str=x \b, commonName=%s
|
||||
>>&0 der seq
|
||||
|
||||
0 search/1 FONT ASCII vfont text
|
||||
0 short 0436 Berkeley vfont data
|
||||
0 short 017001 byte-swapped Berkeley vfont data
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #77961 (finfo_open crafted magic parsing SIGABRT)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
finfo_open(FILEINFO_NONE, __DIR__ . '/bug77961.magic');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: finfo_open(): Warning: Expected numeric type got `indirect' in %s on line %d
|
||||
|
||||
Fatal error: fatal libmagic error in %s on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Cloning and serializing finfo is not supported
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$finfo = new finfo;
|
||||
var_dump($finfo->buffer("Test string"));
|
||||
try {
|
||||
$finfo2 = clone $finfo;
|
||||
var_dump($finfo2->buffer("Test string"));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$finfo3 = unserialize(serialize($finfo));
|
||||
var_dump($finfo3->buffer("Test string"));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
Trying to clone an uncloneable object of class finfo
|
||||
|
||||
Warning: finfo::buffer(): The invalid fileinfo object. in %s on line %d
|
||||
bool(false)
|
||||
@@ -555,6 +555,22 @@ void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int is_userinfo_valid(zend_string *str)
|
||||
{
|
||||
const char *valid = "-._~!$&'()*+,;=:";
|
||||
const char *p = ZSTR_VAL(str);
|
||||
while (p - ZSTR_VAL(str) < ZSTR_LEN(str)) {
|
||||
if (isalpha(*p) || isdigit(*p) || strchr(valid, *p)) {
|
||||
p++;
|
||||
} else if (*p == '%' && p - ZSTR_VAL(str) <= ZSTR_LEN(str) - 3 && isdigit(*(p+1)) && isxdigit(*(p+2))) {
|
||||
p += 3;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
{
|
||||
php_url *url;
|
||||
@@ -615,6 +631,13 @@ bad_url:
|
||||
php_url_free(url);
|
||||
RETURN_VALIDATION_FAILED
|
||||
}
|
||||
|
||||
if (url->user != NULL && !is_userinfo_valid(url->user)) {
|
||||
php_url_free(url);
|
||||
RETURN_VALIDATION_FAILED
|
||||
|
||||
}
|
||||
|
||||
php_url_free(url);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #77423 (parse_url() will deliver a wrong host to user)
|
||||
--FILE--
|
||||
<?php
|
||||
$urls = array(
|
||||
"http://php.net\@aliyun.com/aaa.do",
|
||||
"https://example.com\uFF03@bing.com",
|
||||
);
|
||||
foreach ($urls as $url) {
|
||||
var_dump(filter_var($url, FILTER_VALIDATE_URL));
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
+2
-2
@@ -1136,7 +1136,7 @@ ZEND_FUNCTION(gmp_export)
|
||||
FETCH_GMP_ZVAL(gmpnumber, gmpnumber_arg, temp_a);
|
||||
|
||||
if (mpz_sgn(gmpnumber) == 0) {
|
||||
RETURN_EMPTY_STRING();
|
||||
RETVAL_EMPTY_STRING();
|
||||
} else {
|
||||
size_t bits_per_word = size * 8;
|
||||
size_t count = (mpz_sizeinbase(gmpnumber, 2) + bits_per_word - 1) / bits_per_word;
|
||||
@@ -1145,7 +1145,7 @@ ZEND_FUNCTION(gmp_export)
|
||||
mpz_export(ZSTR_VAL(out_string), NULL, order, size, endian, 0, gmpnumber);
|
||||
ZSTR_VAL(out_string)[ZSTR_LEN(out_string)] = '\0';
|
||||
|
||||
RETURN_NEW_STR(out_string);
|
||||
RETVAL_NEW_STR(out_string);
|
||||
}
|
||||
|
||||
FREE_GMP_TEMP(temp_a);
|
||||
|
||||
@@ -50,6 +50,9 @@ foreach ($export as $k => $test) {
|
||||
|
||||
var_dump($passed);
|
||||
|
||||
// Argument converted from int to GMP
|
||||
var_dump(bin2hex(gmp_export(0xff)));
|
||||
|
||||
// Invalid arguments (zpp failure)
|
||||
var_dump(gmp_export());
|
||||
|
||||
@@ -62,6 +65,7 @@ var_dump(gmp_export(123, 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
|
||||
var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
string(2) "ff"
|
||||
|
||||
Warning: gmp_export() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ int main() {
|
||||
|
||||
int main() {
|
||||
iconv_t cd;
|
||||
cd = iconv_open( "*blahblah*", "*blahblah*" );
|
||||
cd = iconv_open( "*blahblah*", "*blahblahblah*" );
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
if (errno == EINVAL) {
|
||||
return 0;
|
||||
|
||||
+76
-34
@@ -1257,7 +1257,9 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
}
|
||||
#endif
|
||||
|
||||
ZEND_IGNORE_LEAKS_BEGIN();
|
||||
imap_stream = mail_open(NIL, ZSTR_VAL(mailbox), flags);
|
||||
ZEND_IGNORE_LEAKS_END();
|
||||
|
||||
if (imap_stream == NIL) {
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", ZSTR_VAL(mailbox));
|
||||
@@ -1321,7 +1323,7 @@ PHP_FUNCTION(imap_reopen)
|
||||
|
||||
imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), flags);
|
||||
if (imap_le_struct->imap_stream == NIL) {
|
||||
zend_list_delete(Z_RES_P(streamind));
|
||||
zend_list_close(Z_RES_P(streamind));
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -2227,7 +2229,9 @@ PHP_FUNCTION(imap_lsub)
|
||||
IMAPG(folderlist_style) = FLIST_ARRAY;
|
||||
|
||||
IMAPG(imap_sfolders) = NIL;
|
||||
ZEND_IGNORE_LEAKS_BEGIN();
|
||||
mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
|
||||
ZEND_IGNORE_LEAKS_END();
|
||||
if (IMAPG(imap_sfolders) == NIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -2266,7 +2270,9 @@ PHP_FUNCTION(imap_lsub_full)
|
||||
IMAPG(folderlist_style) = FLIST_OBJECT;
|
||||
|
||||
IMAPG(imap_sfolder_objects) = IMAPG(imap_sfolder_objects_tail) = NIL;
|
||||
ZEND_IGNORE_LEAKS_BEGIN();
|
||||
mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
|
||||
ZEND_IGNORE_LEAKS_END();
|
||||
if (IMAPG(imap_sfolder_objects) == NIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -2704,8 +2710,9 @@ PHP_FUNCTION(imap_rfc822_write_address)
|
||||
if (string) {
|
||||
RETVAL_STR(string);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
mail_free_address(&addr);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3086,7 +3093,8 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
if (out == NIL) {
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
RETURN_STRING((char *)out);
|
||||
RETVAL_STRING((char *)out);
|
||||
fs_give((void**) &out);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3192,6 +3200,9 @@ PHP_FUNCTION(imap_sort)
|
||||
} else {
|
||||
spg = mail_newsearchpgm();
|
||||
}
|
||||
if (spg == NIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
mypgm = mail_newsortpgm();
|
||||
mypgm->reverse = rev;
|
||||
@@ -3200,6 +3211,7 @@ PHP_FUNCTION(imap_sort)
|
||||
|
||||
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? ZSTR_VAL(charset) : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
|
||||
|
||||
mail_free_sortpgm(&mypgm);
|
||||
if (spg && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&spg);
|
||||
}
|
||||
@@ -3555,7 +3567,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
int toppart = 0;
|
||||
int first;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &envelope, &body) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/a/", &envelope, &body) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3613,6 +3625,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(envelope), "custom_headers", sizeof("custom_headers") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
custom_headers_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pvalue), env_data) {
|
||||
custom_headers_param = mail_newbody_parameter();
|
||||
convert_to_string_ex(env_data);
|
||||
@@ -3632,17 +3645,25 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
if (Z_TYPE_P(data) != IS_ARRAY) {
|
||||
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
goto done;
|
||||
}
|
||||
SEPARATE_ARRAY(data);
|
||||
|
||||
bod = mail_newbody();
|
||||
topbod = bod;
|
||||
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
|
||||
bod->type = (short) zval_get_long(pvalue);
|
||||
zend_long type = zval_get_long(pvalue);
|
||||
if (type >= 0 && type <= TYPEMAX && body_types[type] != NULL) {
|
||||
bod->type = (short) type;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
|
||||
bod->encoding = (short) zval_get_long(pvalue);
|
||||
zend_long encoding = zval_get_long(pvalue);
|
||||
if (encoding >= 0 && encoding <= ENCMAX && body_encodings[encoding] != NULL) {
|
||||
bod->encoding = (short) encoding;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
@@ -3655,7 +3676,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type.parameters", sizeof("type.parameters") - 1)) != NULL) {
|
||||
if(Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3687,7 +3710,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition", sizeof("disposition") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3699,15 +3724,19 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
bod->disposition.parameter = disp_param;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) {
|
||||
bod->nested.msg = mail_newmsg();
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
|
||||
bod->size.lines = zval_get_long(pvalue);
|
||||
@@ -3719,10 +3748,14 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->md5 = cpystr(Z_STRVAL_P(pvalue));
|
||||
}
|
||||
} else if (Z_TYPE_P(data) == IS_ARRAY) {
|
||||
short type = -1;
|
||||
} else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) {
|
||||
short type = 0;
|
||||
SEPARATE_ARRAY(data);
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
|
||||
type = (short) zval_get_long(pvalue);
|
||||
zend_long tmp_type = zval_get_long(pvalue);
|
||||
if (tmp_type >= 0 && tmp_type <= TYPEMAX && tmp_type != TYPEMULTIPART && body_types[tmp_type] != NULL) {
|
||||
type = (short) tmp_type;
|
||||
}
|
||||
}
|
||||
|
||||
if (!toppart) {
|
||||
@@ -3735,13 +3768,13 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
}
|
||||
|
||||
bod = &mypart->body;
|
||||
|
||||
if (type != TYPEMULTIPART) {
|
||||
bod->type = type;
|
||||
}
|
||||
bod->type = type;
|
||||
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
|
||||
bod->encoding = (short) zval_get_long(pvalue);
|
||||
zend_long encoding = zval_get_long(pvalue);
|
||||
if (encoding >= 0 && encoding <= ENCMAX && body_encodings[encoding] != NULL) {
|
||||
bod->encoding = (short) encoding;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
@@ -3755,7 +3788,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type.parameters", sizeof("type.parameters") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3787,7 +3822,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition", sizeof("disposition") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3799,15 +3836,19 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
bod->disposition.parameter = disp_param;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) {
|
||||
bod->nested.msg = mail_newmsg();
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
|
||||
bod->size.lines = zval_get_long(pvalue);
|
||||
@@ -3824,7 +3865,8 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
if (first) {
|
||||
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
|
||||
@@ -3907,7 +3949,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
bod=&part->body;
|
||||
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF);
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data ? (char *) bod->contents.text.data : "", CRLF);
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} while ((part = part->next)); /* until done */
|
||||
@@ -3917,7 +3959,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} else if (bod) {
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF);
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data ? (char *) bod->contents.text.data : "", CRLF);
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #64076 (imap_sort() does not return FALSE on failure)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__ . '/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/imap_include.inc';
|
||||
$stream = setup_test_mailbox('', 2);
|
||||
imap_errors(); // clear error stack
|
||||
var_dump(imap_sort($stream, SORTFROM, 0, 0, 'UNSUPPORTED SEARCH CRITERIUM'));
|
||||
var_dump(imap_errors() !== false);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once __DIR__ . '/clean.inc';
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 2 msgs
|
||||
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -11,5 +11,5 @@ imap_mail('1', 1, NULL);
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imap_mail(): No message string in mail command in %s on line %d
|
||||
%s
|
||||
%A
|
||||
===DONE===
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #80213 (imap_mail_compose() segfaults on certain $bodies)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [];
|
||||
$body = [[
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
], [
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
]];
|
||||
imap_mail_compose($envelope, $body);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,69 @@
|
||||
--TEST--
|
||||
Bug #80215 (imap_mail_compose() may modify by-val parameters)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [
|
||||
"from" => 1,
|
||||
"to" => 2,
|
||||
"custom_headers" => [3],
|
||||
];
|
||||
$body = [[
|
||||
"contents.data" => 4,
|
||||
"type.parameters" => ['foo' => 5],
|
||||
"disposition" => ['bar' => 6],
|
||||
], [
|
||||
"contents.data" => 7,
|
||||
"type.parameters" => ['foo' => 8],
|
||||
"disposition" => ['bar' => 9],
|
||||
]];
|
||||
imap_mail_compose($envelope, $body);
|
||||
var_dump($envelope, $body);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["from"]=>
|
||||
int(1)
|
||||
["to"]=>
|
||||
int(2)
|
||||
["custom_headers"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(4)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(5)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(7)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(8)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(9)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80216 (imap_mail_compose() does not validate types/encodings)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], []]);
|
||||
imap_mail_compose([], [['type' => 12]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['type' => 12]]);
|
||||
imap_mail_compose([], [['encoding' => 8]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['encoding' => 8]]);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #80220 (imap_mail_compose() may leak memory) - message/rfc822 regression
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imap_mail_compose([], []);
|
||||
imap_mail_compose([], [1]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
|
||||
|
||||
Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #80226 (imap_sort() leaks sortpgm memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(__DIR__.'/imap_include.inc');
|
||||
$stream = imap_open($default_mailbox, $username, $password);
|
||||
imap_sort($stream, SORTFROM, 0);
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #80242 (imap_mail_compose() segfaults for multipart with rfc822)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMULTIPART,
|
||||
], [
|
||||
'type' => TYPETEXT,
|
||||
'contents.data' => 'some text',
|
||||
], [
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
]];
|
||||
imap_mail_compose([], $bodies);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
imap_rfc822_write_address() : basic functionality
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imap_rfc822_write_address('me', 'example.com', 'My Name'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(24) "My Name <me@example.com>"
|
||||
@@ -36,6 +36,7 @@ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
|
||||
int spattern_len = 0;
|
||||
zval* object;
|
||||
MessageFormatter_object* mfo;
|
||||
UParseError parse_error;
|
||||
int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
|
||||
intl_error_reset( NULL );
|
||||
|
||||
@@ -79,12 +80,26 @@ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
|
||||
(mfo)->mf_data.orig_format_len = pattern_len;
|
||||
|
||||
/* Create an ICU message formatter. */
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, locale, NULL, &INTL_DATA_ERROR_CODE(mfo));
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, locale, &parse_error, &INTL_DATA_ERROR_CODE(mfo));
|
||||
|
||||
if(spattern) {
|
||||
efree(spattern);
|
||||
}
|
||||
|
||||
if (INTL_DATA_ERROR_CODE( mfo ) == U_PATTERN_SYNTAX_ERROR) {
|
||||
char *msg = NULL;
|
||||
smart_str parse_error_str;
|
||||
parse_error_str = intl_parse_error_to_string( &parse_error );
|
||||
spprintf( &msg, 0, "pattern syntax error (%s)", parse_error_str.s? ZSTR_VAL(parse_error_str.s) : "unknown parser error" );
|
||||
smart_str_free( &parse_error_str );
|
||||
|
||||
intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( mfo ) );
|
||||
intl_errors_set_custom_msg( INTL_DATA_ERROR_P( mfo ), msg, 1 );
|
||||
|
||||
efree( msg );
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: message formatter creation failed");
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -116,7 +131,9 @@ PHP_METHOD( MessageFormatter, __construct )
|
||||
return_value = ZEND_THIS;
|
||||
if (msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
|
||||
if (!EG(exception)) {
|
||||
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);
|
||||
zend_string *err = intl_error_get_message(NULL);
|
||||
zend_throw_exception(IntlException_ce_ptr, ZSTR_VAL(err), intl_error_get_code(NULL));
|
||||
zend_string_release_ex(err, 0);
|
||||
}
|
||||
}
|
||||
zend_restore_error_handling(&error_handling);
|
||||
|
||||
@@ -94,6 +94,7 @@ PHP_FUNCTION( msgfmt_format_message )
|
||||
size_t slocale_len = 0;
|
||||
MessageFormatter_object mf;
|
||||
MessageFormatter_object *mfo = &mf;
|
||||
UParseError parse_error;
|
||||
|
||||
/* Parse parameters. */
|
||||
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "ssa",
|
||||
@@ -136,10 +137,25 @@ PHP_FUNCTION( msgfmt_format_message )
|
||||
#endif
|
||||
|
||||
/* Create an ICU message formatter. */
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, &parse_error, &INTL_DATA_ERROR_CODE(mfo));
|
||||
if(spattern && spattern_len) {
|
||||
efree(spattern);
|
||||
}
|
||||
|
||||
if (INTL_DATA_ERROR_CODE( mfo ) == U_PATTERN_SYNTAX_ERROR) {
|
||||
char *msg = NULL;
|
||||
smart_str parse_error_str;
|
||||
parse_error_str = intl_parse_error_to_string( &parse_error );
|
||||
spprintf( &msg, 0, "pattern syntax error (%s)", parse_error_str.s? ZSTR_VAL(parse_error_str.s) : "unknown parser error" );
|
||||
smart_str_free( &parse_error_str );
|
||||
|
||||
intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( mfo ) );
|
||||
intl_errors_set_custom_msg( INTL_DATA_ERROR_P( mfo ), msg, 1 );
|
||||
|
||||
efree( msg );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
|
||||
|
||||
msgfmt_do_format(mfo, args, return_value);
|
||||
|
||||
@@ -46,25 +46,26 @@ extern "C" {
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
/**
|
||||
* This class isolates our access to private internal methods of
|
||||
* MessageFormat. It is never instantiated; it exists only for C++
|
||||
* access management.
|
||||
* ICU declares MessageFormatAdapter as a friend class of MessageFormat,
|
||||
* to use as a backdoor for accessing private MessageFormat members.
|
||||
* We use it for the same purpose here. Prefix the methods with php to
|
||||
* avoid clashes with any definitions in ICU.
|
||||
*/
|
||||
class MessageFormatAdapter {
|
||||
public:
|
||||
static const Formattable::Type* getArgTypeList(const MessageFormat& m,
|
||||
static const Formattable::Type* phpGetArgTypeList(const MessageFormat& m,
|
||||
int32_t& count);
|
||||
static const MessagePattern getMessagePattern(MessageFormat* m);
|
||||
static const MessagePattern phpGetMessagePattern(MessageFormat* m);
|
||||
};
|
||||
|
||||
const Formattable::Type*
|
||||
MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
|
||||
MessageFormatAdapter::phpGetArgTypeList(const MessageFormat& m,
|
||||
int32_t& count) {
|
||||
return m.getArgTypeList(count);
|
||||
}
|
||||
|
||||
const MessagePattern
|
||||
MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
|
||||
MessageFormatAdapter::phpGetMessagePattern(MessageFormat* m) {
|
||||
return m->msgPattern;
|
||||
}
|
||||
U_NAMESPACE_END
|
||||
@@ -80,7 +81,7 @@ using icu::FieldPosition;
|
||||
U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
|
||||
{
|
||||
int32_t fmt_count = 0;
|
||||
MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
|
||||
MessageFormatAdapter::phpGetArgTypeList(*(const MessageFormat*)fmt, fmt_count);
|
||||
return fmt_count;
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
|
||||
return mfo->mf_data.arg_types;
|
||||
}
|
||||
|
||||
const Formattable::Type *types = MessageFormatAdapter::getArgTypeList(
|
||||
const Formattable::Type *types = MessageFormatAdapter::phpGetArgTypeList(
|
||||
*(MessageFormat*)mfo->mf_data.umsgf, parts_count);
|
||||
|
||||
/* Hash table will store Formattable::Type objects directly,
|
||||
@@ -288,7 +289,7 @@ static HashTable *umsg_get_types(MessageFormatter_object *mfo,
|
||||
{
|
||||
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
|
||||
|
||||
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
|
||||
const MessagePattern mp = MessageFormatAdapter::phpGetMessagePattern(mf);
|
||||
|
||||
return umsg_parse_format(mfo, mp, err);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--TEST--
|
||||
locale_get_display_language()
|
||||
locale_get_display_language() icu < 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
--TEST--
|
||||
locale_get_display_language() icu >= 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') < 0) die('skip for ICU >= 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_language for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
'art-lojban', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_language( $locale ,$disp_locale );
|
||||
$res_str .= "disp_locale=$disp_locale : display_language=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_language=Ukrainian
|
||||
disp_locale=fr : display_language=ukrainien
|
||||
disp_locale=de : display_language=Ukrainisch
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_language=(Root|Unknown language)
|
||||
disp_locale=fr : display_language=(racine|langue indéterminée)
|
||||
disp_locale=de : display_language=([rR]oot|Unbekannte Sprache)
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_language=Ukrainian
|
||||
disp_locale=fr : display_language=ukrainien
|
||||
disp_locale=de : display_language=Ukrainisch
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_language=hindi
|
||||
disp_locale=fr : display_language=hindi
|
||||
disp_locale=de : display_language=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_language=German
|
||||
disp_locale=fr : display_language=allemand
|
||||
disp_locale=de : display_language=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_language=French
|
||||
disp_locale=fr : display_language=français
|
||||
disp_locale=de : display_language=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_language=Japanese
|
||||
disp_locale=fr : display_language=japonais
|
||||
disp_locale=de : display_language=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_language=i-enochian
|
||||
disp_locale=fr : display_language=i-enochian
|
||||
disp_locale=de : display_language=i-enochian
|
||||
-----------------
|
||||
locale='art-lojban'
|
||||
disp_locale=en : display_language=Lojban
|
||||
disp_locale=fr : display_language=lojban
|
||||
disp_locale=de : display_language=Lojban
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_language=Serbian
|
||||
disp_locale=fr : display_language=serbe
|
||||
disp_locale=de : display_language=Serbisch
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_language=Serbian
|
||||
disp_locale=fr : display_language=serbe
|
||||
disp_locale=de : display_language=Serbisch
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_language=Serbian
|
||||
disp_locale=fr : display_language=serbe
|
||||
disp_locale=de : display_language=Serbisch
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_language=Slovenian
|
||||
disp_locale=fr : display_language=slovène
|
||||
disp_locale=de : display_language=Slowenisch
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_language=Slovenian
|
||||
disp_locale=fr : display_language=slovène
|
||||
disp_locale=de : display_language=Slowenisch
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_language=German
|
||||
disp_locale=fr : display_language=allemand
|
||||
disp_locale=de : display_language=Deutsch
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_language=Slovenian
|
||||
disp_locale=fr : display_language=slovène
|
||||
disp_locale=de : display_language=Slowenisch
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_language=Slovenian
|
||||
disp_locale=fr : display_language=slovène
|
||||
disp_locale=de : display_language=Slowenisch
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_language=German
|
||||
disp_locale=fr : display_language=allemand
|
||||
disp_locale=de : display_language=Deutsch
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_language=English
|
||||
disp_locale=fr : display_language=anglais
|
||||
disp_locale=de : display_language=Englisch
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_language=Spanish
|
||||
disp_locale=fr : display_language=espagnol
|
||||
disp_locale=de : display_language=Spanisch
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_language=German
|
||||
disp_locale=fr : display_language=allemand
|
||||
disp_locale=de : display_language=Deutsch
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_language=Azerbaijani
|
||||
disp_locale=fr : display_language=azerbaïdjanais
|
||||
disp_locale=de : display_language=Aserbaidschanisch
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_language=x-whatever
|
||||
disp_locale=fr : display_language=x-whatever
|
||||
disp_locale=de : display_language=x-whatever
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_language=qaa
|
||||
disp_locale=fr : display_language=qaa
|
||||
disp_locale=de : display_language=qaa
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_language=Serbian
|
||||
disp_locale=fr : display_language=serbe
|
||||
disp_locale=de : display_language=Serbisch
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_language=Serbian
|
||||
disp_locale=fr : display_language=serbe
|
||||
disp_locale=de : display_language=Serbisch
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_language=English
|
||||
disp_locale=fr : display_language=anglais
|
||||
disp_locale=de : display_language=Englisch
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_language=Chinese
|
||||
disp_locale=fr : display_language=chinois
|
||||
disp_locale=de : display_language=Chinesisch
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_language=English
|
||||
disp_locale=fr : display_language=anglais
|
||||
disp_locale=de : display_language=Englisch
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_language=German
|
||||
disp_locale=fr : display_language=allemand
|
||||
disp_locale=de : display_language=Deutsch
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_language=a
|
||||
disp_locale=fr : display_language=a
|
||||
disp_locale=de : display_language=a
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_language=Arabic
|
||||
disp_locale=fr : display_language=arabe
|
||||
disp_locale=de : display_language=Arabisch
|
||||
-----------------
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 64.0
|
||||
locale_get_display_name() icu >= 65.0 && icu < 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') < 0) die('skip for ICU >= 65.0'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') < 0) die('skip for ICU >= 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_name for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'sl_IT_nedis_KIRTI',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'zh-hakka',
|
||||
'zh-wuu',
|
||||
'i-tay',
|
||||
'sgn-BE-nl',
|
||||
'sgn-CH-de',
|
||||
'sl_IT_rozaj@currency=EUR',
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
|
||||
$scr = str_replace(array('(', ')'), '#', $scr);
|
||||
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='sl_IT_nedis_KIRTI'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
|
||||
-----------------
|
||||
locale='sl_IT_nedis-a-kirti-x-xyz'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
|
||||
-----------------
|
||||
locale='sl_IT_NEDIS_ROJAZ_1901'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-hakka'
|
||||
disp_locale=en : display_name=Chinese( #HAKKA#)?
|
||||
disp_locale=fr : display_name=chinois( #HAKKA#)?
|
||||
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
|
||||
-----------------
|
||||
locale='zh-wuu'
|
||||
disp_locale=en : display_name=Chinese #WUU#
|
||||
disp_locale=fr : display_name=chinois #WUU#
|
||||
disp_locale=de : display_name=Chinesisch #WUU#
|
||||
-----------------
|
||||
locale='i-tay'
|
||||
disp_locale=en : display_name=i-tay
|
||||
disp_locale=fr : display_name=i-tay
|
||||
disp_locale=de : display_name=i-tay
|
||||
-----------------
|
||||
locale='sgn-BE-nl'
|
||||
disp_locale=en : display_name=sgn #Belgium, NL#
|
||||
disp_locale=fr : display_name=sgn #Belgique, NL#
|
||||
disp_locale=de : display_name=sgn #Belgien, NL#
|
||||
-----------------
|
||||
locale='sgn-CH-de'
|
||||
disp_locale=en : display_name=sgn #Switzerland, DE#
|
||||
disp_locale=fr : display_name=sgn #Suisse, DE#
|
||||
disp_locale=de : display_name=sgn #Schweiz, DE#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj@currency=EUR'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
|
||||
-----------------
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_name=
|
||||
disp_locale=fr : display_name=
|
||||
disp_locale=de : display_name=
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_name=Unknown language
|
||||
disp_locale=fr : display_name=langue indéterminée
|
||||
disp_locale=de : display_name=Unbekannte Sprache
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
|
||||
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
|
||||
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_name=hindi
|
||||
disp_locale=fr : display_name=hindi
|
||||
disp_locale=de : display_name=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_name=German
|
||||
disp_locale=fr : display_name=allemand
|
||||
disp_locale=de : display_name=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_name=French
|
||||
disp_locale=fr : display_name=français
|
||||
disp_locale=de : display_name=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_name=Japanese
|
||||
disp_locale=fr : display_name=japonais
|
||||
disp_locale=de : display_name=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_name=Chinese #Traditional#
|
||||
disp_locale=fr : display_name=chinois #traditionnel#
|
||||
disp_locale=de : display_name=Chinesisch #Traditionell#
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_name=Chinese #Simplified#
|
||||
disp_locale=fr : display_name=chinois #simplifié#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht#
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_name=Serbian #Cyrillic#
|
||||
disp_locale=fr : display_name=serbe #cyrillique#
|
||||
disp_locale=de : display_name=Serbisch #Kyrillisch#
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_name=Serbian #Latin#
|
||||
disp_locale=fr : display_name=serbe #latin#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch#
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_name=Chinese #Simplified, China#
|
||||
disp_locale=fr : display_name=chinois #simplifié, Chine#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_name=Serbian #Latin, Serbia#
|
||||
disp_locale=fr : display_name=serbe #latin, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Resian#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
|
||||
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_name=German #Germany#
|
||||
disp_locale=fr : display_name=allemand #Allemagne#
|
||||
disp_locale=de : display_name=Deutsch #Deutschland#
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_name=English #United States#
|
||||
disp_locale=fr : display_name=anglais #États-Unis#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_name=Spanish #Latin America#
|
||||
disp_locale=fr : display_name=espagnol #Amérique latine#
|
||||
disp_locale=de : display_name=Spanisch #Lateinamerika#
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
|
||||
disp_locale=fr : display_name=allemand #Suisse, usage privé=phonebk#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
|
||||
disp_locale=fr : display_name=azerbaïdjanais #arabe, usage privé=aze-derbend#
|
||||
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_name=Chinese #MIN#
|
||||
disp_locale=fr : display_name=chinois #MIN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN#
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
|
||||
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
|
||||
disp_locale=fr : display_name=x-whatever #usage privé=whatever#
|
||||
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
|
||||
disp_locale=fr : display_name=qaa #Qaaa, QM, usage privé=southern#
|
||||
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_name=Serbian #Latin, QM#
|
||||
disp_locale=fr : display_name=serbe #latin, QM#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
|
||||
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_name=English #United States, attribute=islamcal#
|
||||
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
|
||||
disp_locale=fr : display_name=chinois #Chine, a=myext, usage privé=private#
|
||||
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_name=English #a=myext, b=another#
|
||||
disp_locale=fr : display_name=anglais #a=myext, b=another#
|
||||
disp_locale=de : display_name=Englisch #a=myext, b=another#
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_name=German #Latin America, DE#
|
||||
disp_locale=fr : display_name=allemand #Amérique latine, DE#
|
||||
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_name=a #Germany#
|
||||
disp_locale=fr : display_name=a #Allemagne#
|
||||
disp_locale=de : display_name=a #Deutschland#
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
|
||||
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
|
||||
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
|
||||
-----------------
|
||||
@@ -96,12 +96,12 @@ Warning: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
Warning: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
|
||||
IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
|
||||
IntlException: msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR in %s on line %d
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
|
||||
IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
|
||||
IntlException: msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR in %s on line %d
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
@@ -115,17 +115,17 @@ Warning: MessageFormatter::create() expects parameter 1 to be string, array give
|
||||
Warning: msgfmt_create() expects parameter 1 to be string, array given in %s on line %d
|
||||
'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
|
||||
IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
|
||||
'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR'
|
||||
'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR'
|
||||
IntlException: pattern syntax error (parse error at offset 1, after "{", before or at "0,choice}"): U_PATTERN_SYNTAX_ERROR in %s on line %d
|
||||
'pattern syntax error (parse error at offset 1, after "{", before or at "0,choice}"): U_PATTERN_SYNTAX_ERROR'
|
||||
'pattern syntax error (parse error at offset 1, after "{", before or at "0,choice}"): U_PATTERN_SYNTAX_ERROR'
|
||||
'pattern syntax error (parse error at offset 1, after "{", before or at "0,choice}"): U_PATTERN_SYNTAX_ERROR'
|
||||
|
||||
IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
|
||||
IntlException: msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES in %s on line %d
|
||||
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
|
||||
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
|
||||
'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES'
|
||||
|
||||
IntlException: Constructor failed in %smsgfmt_fail2.php on line %d
|
||||
IntlException: msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND in %s on line %d
|
||||
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
|
||||
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
|
||||
'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND'
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test icu >= 61.1 && icu < 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test icu >= 68.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') < 0) die('skip for ICU >= 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
$br = $rbbi->getBinaryRules();
|
||||
|
||||
$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
|
||||
|
||||
var_dump($rbbi->getRules(), $rbbi2->getRules());
|
||||
var_dump($rbbi->getRules() == $rbbi2->getRules());
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(119) "$LN=[[:letter:][:number:]];$S=[.;,:];!!forward;$LN+{1};$S+{42};!!reverse;$LN+{1};$S+{42};!!safe_forward;!!safe_reverse;"
|
||||
string(119) "$LN=[[:letter:][:number:]];$S=[.;,:];!!forward;$LN+{1};$S+{42};!!reverse;$LN+{1};$S+{42};!!safe_forward;!!safe_reverse;"
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test icu >= 61.1 && icu < 68.1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') >= 0) die('skip for ICU < 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test icu >= 68.1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '68.1') < 0) die('skip for ICU >= 68.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump($rbbi->getRules());
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(119) "$LN=[[:letter:][:number:]];$S=[.;,:];!!forward;$LN+{1};$S+{42};!!reverse;$LN+{1};$S+{42};!!safe_forward;!!safe_reverse;"
|
||||
==DONE==
|
||||
@@ -47,14 +47,8 @@ if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then
|
||||
elif test "$PHP_MYSQLI" != "no"; then
|
||||
|
||||
MYSQL_CONFIG=$PHP_MYSQLI
|
||||
|
||||
MYSQL_LIB_NAME='mysqlclient'
|
||||
if test "$enable_maintainer_zts" = "yes"; then
|
||||
MYSQL_LIB_CFG='--libs_r'
|
||||
MYSQL_LIB_NAME='mysqlclient_r'
|
||||
else
|
||||
MYSQL_LIB_CFG='--libs'
|
||||
fi
|
||||
MYSQL_LIB_CFG='--libs'
|
||||
|
||||
if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then
|
||||
MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
|
||||
|
||||
+18
-31
@@ -699,7 +699,7 @@ PHP_MINIT_FUNCTION(mysqli)
|
||||
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_INT_AND_FLOAT_NATIVE", MYSQLND_OPT_INT_AND_FLOAT_NATIVE, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
#if MYSQL_VERSION_ID > 50110 || defined(MYSQLI_USE_MYSQLND)
|
||||
#if (MYSQL_VERSION_ID > 50110 && MYSQL_VERSION_ID < 80000) || (MYSQL_VERSION_ID >= 100000) || defined(MYSQLI_USE_MYSQLND)
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
|
||||
@@ -1041,51 +1041,38 @@ PHP_FUNCTION(mysqli_stmt_construct)
|
||||
zval *mysql_link;
|
||||
MY_STMT *stmt;
|
||||
MYSQLI_RESOURCE *mysqli_resource;
|
||||
char *statement;
|
||||
char *statement = NULL;
|
||||
size_t statement_len;
|
||||
|
||||
switch (ZEND_NUM_ARGS())
|
||||
{
|
||||
case 1: /* mysql_stmt_init */
|
||||
if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
|
||||
|
||||
stmt->stmt = mysql_stmt_init(mysql->mysql);
|
||||
break;
|
||||
case 2:
|
||||
if (zend_parse_parameters(2, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
|
||||
|
||||
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
|
||||
mysql_stmt_prepare(stmt->stmt, (char *)statement, statement_len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s!", &mysql_link, mysqli_link_class_entry, &statement, &statement_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (!stmt->stmt) {
|
||||
stmt = (MY_STMT *) ecalloc(1, sizeof(MY_STMT));
|
||||
|
||||
if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) {
|
||||
efree(stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
#ifndef MYSQLI_USE_MYSQLND
|
||||
ZVAL_COPY(&stmt->link_handle, mysql_link);
|
||||
#endif
|
||||
|
||||
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
|
||||
mysqli_resource->ptr = (void *)stmt;
|
||||
mysqli_resource->status = (ZEND_NUM_ARGS() == 1) ? MYSQLI_STATUS_INITIALIZED : MYSQLI_STATUS_VALID;
|
||||
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
|
||||
|
||||
MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis());
|
||||
|
||||
if (statement) {
|
||||
if(mysql_stmt_prepare(stmt->stmt, statement, statement_len)) {
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
mysqli_resource->status = MYSQLI_STATUS_VALID;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+27
-7
@@ -171,6 +171,7 @@ PHP_FUNCTION(mysqli_autocommit)
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (mysql_autocommit(mysql->mysql, (my_bool)automode)) {
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -614,7 +615,7 @@ PHP_FUNCTION(mysqli_change_user)
|
||||
size_t user_len, password_len, dbname_len;
|
||||
zend_ulong rc;
|
||||
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
|
||||
const CHARSET_INFO * old_charset;
|
||||
MY_CHARSET_INFO old_charset;
|
||||
#endif
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
|
||||
@@ -623,7 +624,7 @@ PHP_FUNCTION(mysqli_change_user)
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
|
||||
old_charset = mysql->mysql->charset;
|
||||
mysql_get_character_set_info(mysql->mysql, &old_charset);
|
||||
#endif
|
||||
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
@@ -643,7 +644,7 @@ PHP_FUNCTION(mysqli_change_user)
|
||||
5.0 doesn't support it. Support added in 5.1.23 by fixing the following bug :
|
||||
Bug #30472 libmysql doesn't reset charset, insert_id after succ. mysql_change_user() call
|
||||
*/
|
||||
rc = mysql_set_character_set(mysql->mysql, old_charset->csname);
|
||||
rc = mysql_set_character_set(mysql->mysql, old_charset.csname);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -754,6 +755,7 @@ PHP_FUNCTION(mysqli_commit)
|
||||
#else
|
||||
if (FAIL == mysqlnd_commit(mysql->mysql, flags, name)) {
|
||||
#endif
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1123,7 +1125,8 @@ void mysqli_stmt_fetch_mysqlnd(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (FAIL == mysqlnd_stmt_fetch(stmt->stmt, &fetched_anything)) {
|
||||
if (FAIL == mysqlnd_stmt_fetch(stmt->stmt, &fetched_anything)) {
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_BOOL(FALSE);
|
||||
} else if (fetched_anything == TRUE) {
|
||||
RETURN_BOOL(TRUE);
|
||||
@@ -1605,7 +1608,11 @@ PHP_FUNCTION(mysqli_next_result) {
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
RETURN_BOOL(!mysql_next_result(mysql->mysql));
|
||||
if (mysql_next_result(mysql->mysql)) {
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1637,7 +1644,11 @@ PHP_FUNCTION(mysqli_stmt_next_result) {
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
RETURN_BOOL(!mysql_stmt_next_result(stmt->stmt));
|
||||
if (mysql_stmt_next_result(stmt->stmt)) {
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
@@ -1701,10 +1712,12 @@ static int mysqli_options_get_option_zval_type(int option)
|
||||
#endif /* MySQL 4.1.0 */
|
||||
case MYSQL_OPT_READ_TIMEOUT:
|
||||
case MYSQL_OPT_WRITE_TIMEOUT:
|
||||
#ifdef MYSQL_OPT_GUESS_CONNECTION /* removed in MySQL-8.0 */
|
||||
case MYSQL_OPT_GUESS_CONNECTION:
|
||||
case MYSQL_OPT_USE_EMBEDDED_CONNECTION:
|
||||
case MYSQL_OPT_USE_REMOTE_CONNECTION:
|
||||
case MYSQL_SECURE_AUTH:
|
||||
#endif
|
||||
#ifdef MYSQL_OPT_RECONNECT
|
||||
case MYSQL_OPT_RECONNECT:
|
||||
#endif /* MySQL 5.0.13 */
|
||||
@@ -1939,6 +1952,11 @@ PHP_FUNCTION(mysqli_real_query)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if defined(MYSQLI_USE_MYSQLND) || MYSQL_VERSION_ID < 50707 || defined(MARIADB_BASE_VERSION)
|
||||
# define mysql_real_escape_string_quote(mysql, to, from, length, quote) \
|
||||
mysql_real_escape_string(mysql, to, from, length)
|
||||
#endif
|
||||
|
||||
/* {{{ proto string mysqli_real_escape_string(object link, string escapestr)
|
||||
Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection */
|
||||
PHP_FUNCTION(mysqli_real_escape_string) {
|
||||
@@ -1954,7 +1972,7 @@ PHP_FUNCTION(mysqli_real_escape_string) {
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
newstr = zend_string_alloc(2 * escapestr_len, 0);
|
||||
ZSTR_LEN(newstr) = mysql_real_escape_string(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len);
|
||||
ZSTR_LEN(newstr) = mysql_real_escape_string_quote(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len, '\'');
|
||||
newstr = zend_string_truncate(newstr, ZSTR_LEN(newstr), 0);
|
||||
|
||||
RETURN_NEW_STR(newstr);
|
||||
@@ -1981,6 +1999,7 @@ PHP_FUNCTION(mysqli_rollback)
|
||||
#else
|
||||
if (FAIL == mysqlnd_rollback(mysql->mysql, flags, name)) {
|
||||
#endif
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -2342,6 +2361,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
|
||||
#else
|
||||
if (FAIL == mysql_stmt_attr_set(stmt->stmt, attr, mode_p)) {
|
||||
#endif
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
|
||||
+27
-28
@@ -328,7 +328,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
||||
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
|
||||
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
mysql->mysql->reconnect = MyG(reconnect);
|
||||
char reconnect = MyG(reconnect);
|
||||
mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
|
||||
#endif
|
||||
unsigned int allow_local_infile = MyG(allow_local_infile);
|
||||
mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile);
|
||||
@@ -1112,45 +1113,43 @@ extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const nam
|
||||
static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name)
|
||||
{
|
||||
int ret;
|
||||
zend_bool err = FALSE;
|
||||
smart_str tmp_str = {0};
|
||||
char * name_esc;
|
||||
char * query;
|
||||
unsigned int query_len;
|
||||
if (mode & TRANS_START_WITH_CONSISTENT_SNAPSHOT) {
|
||||
if (tmp_str.s) {
|
||||
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
|
||||
}
|
||||
smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1);
|
||||
}
|
||||
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
|
||||
if (mysql_get_server_version(conn) < 50605L) {
|
||||
php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
|
||||
err = TRUE;
|
||||
} else if (mode & TRANS_START_READ_WRITE) {
|
||||
if (tmp_str.s) {
|
||||
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
|
||||
}
|
||||
smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1);
|
||||
} else if (mode & TRANS_START_READ_ONLY) {
|
||||
if (tmp_str.s) {
|
||||
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
|
||||
}
|
||||
smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1);
|
||||
if (mode & TRANS_START_READ_WRITE) {
|
||||
if (tmp_str.s) {
|
||||
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
|
||||
}
|
||||
smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1);
|
||||
} else if (mode & TRANS_START_READ_ONLY) {
|
||||
if (tmp_str.s) {
|
||||
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
|
||||
}
|
||||
smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1);
|
||||
}
|
||||
smart_str_0(&tmp_str);
|
||||
|
||||
if (err == FALSE){
|
||||
char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
|
||||
char * query;
|
||||
unsigned int query_len = spprintf(&query, 0, "START TRANSACTION%s %s",
|
||||
name_esc? name_esc:"", tmp_str.s? ZSTR_VAL(tmp_str.s):"");
|
||||
name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
|
||||
query_len = spprintf(&query, 0, "START TRANSACTION%s %s",
|
||||
name_esc? name_esc:"", tmp_str.s? ZSTR_VAL(tmp_str.s):"");
|
||||
|
||||
smart_str_free(&tmp_str);
|
||||
if (name_esc) {
|
||||
efree(name_esc);
|
||||
}
|
||||
smart_str_free(&tmp_str);
|
||||
if (name_esc) {
|
||||
efree(name_esc);
|
||||
}
|
||||
|
||||
ret = mysql_real_query(conn, query, query_len);
|
||||
efree(query);
|
||||
ret = mysql_real_query(conn, query, query_len);
|
||||
efree(query);
|
||||
|
||||
if (ret && mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY) && mysql_errno(conn) == 1064) {
|
||||
php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1260,7 +1259,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) {
|
||||
#else
|
||||
if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
|
||||
if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {
|
||||
#endif
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
#define WE_HAD_MBSTATE_T
|
||||
#endif
|
||||
|
||||
#include <my_global.h>
|
||||
|
||||
#if !defined(HAVE_MBRLEN) && defined(WE_HAD_MBRLEN)
|
||||
#define HAVE_MBRLEN 1
|
||||
#endif
|
||||
@@ -64,20 +62,12 @@
|
||||
#define HAVE_MBSTATE_T 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
We need more than mysql.h because we need CHARSET_INFO in one place.
|
||||
This order has been borrowed from the ODBC driver. Nothing can be removed
|
||||
from the list of headers :(
|
||||
*/
|
||||
|
||||
#include <my_sys.h>
|
||||
#include <mysql.h>
|
||||
#if MYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000
|
||||
typedef _Bool my_bool;
|
||||
#endif
|
||||
#include <errmsg.h>
|
||||
#include <my_list.h>
|
||||
#include <m_string.h>
|
||||
#include <mysqld_error.h>
|
||||
#include <my_list.h>
|
||||
#include <m_ctype.h>
|
||||
#include "mysqli_libmysql.h"
|
||||
#endif /* MYSQLI_USE_MYSQLND */
|
||||
|
||||
|
||||
+38
-38
@@ -8,55 +8,55 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$test = "";
|
||||
$test = "";
|
||||
|
||||
/*** test mysqli_connect localhost:port ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
|
||||
$test .= ($link) ? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_connect localhost:port ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
|
||||
$test .= ($link) ? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect ***/
|
||||
$link = mysqli_init();
|
||||
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect ***/
|
||||
$link = mysqli_init();
|
||||
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect with db ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect with db ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect with port ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1":"0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect with port ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1":"0";
|
||||
mysqli_close($link);
|
||||
|
||||
/* temporary addition for Kent's setup, Win32 box */
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if (!$link = mysqli_init())
|
||||
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
/* temporary addition for Kent's setup, Win32 box */
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if (!$link = mysqli_init())
|
||||
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
mysqli_close($link);
|
||||
}
|
||||
mysqli_close($link);
|
||||
}
|
||||
|
||||
/*** test mysqli_real_connect compressed ***/
|
||||
/*
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect compressed ***/
|
||||
/*
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
*/
|
||||
/* todo ssl connections */
|
||||
/* todo ssl connections */
|
||||
|
||||
var_dump($test);
|
||||
print "done!";
|
||||
var_dump($test);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
%s(4) "1111"
|
||||
|
||||
+29
-29
@@ -7,44 +7,44 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
|
||||
if (!$rc)
|
||||
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$rc)
|
||||
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
if (!$rc)
|
||||
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
if (!$rc)
|
||||
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -53,7 +53,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+54
-54
@@ -7,70 +7,70 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6)) ENGINE=" . $engine);
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6)) ENGINE=" . $engine);
|
||||
|
||||
/*
|
||||
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
|
||||
From the manual:
|
||||
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
|
||||
[...]
|
||||
Display widths (used as described in the preceding section) are no longer supported.
|
||||
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
|
||||
the display width is ignored.
|
||||
[...]
|
||||
*/
|
||||
if (!$rc)
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp) ENGINE=" . $engine);
|
||||
/*
|
||||
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
|
||||
From the manual:
|
||||
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
|
||||
[...]
|
||||
Display widths (used as described in the preceding section) are no longer supported.
|
||||
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
|
||||
the display width is ignored.
|
||||
[...]
|
||||
*/
|
||||
if (!$rc)
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp) ENGINE=" . $engine);
|
||||
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
|
||||
'2002-01-02',
|
||||
'12:49:00',
|
||||
'2002-01-02 17:46:59',
|
||||
2010,
|
||||
'2010-07-10',
|
||||
'2020','1999-12-29')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
|
||||
'2002-01-02',
|
||||
'12:49:00',
|
||||
'2002-01-02 17:46:59',
|
||||
2010,
|
||||
'2010-07-10',
|
||||
'2020','1999-12-29')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -79,7 +79,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
Loaded 100 of 686 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user