mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-14 20:50:50 +00:00
Compare commits
243
Commits
php-7.1.16
...
php-7.1.22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f6558bf5d | ||
|
|
c1372ebdf1 | ||
|
|
318a5402c1 | ||
|
|
b791f429db | ||
|
|
7d16058be7 | ||
|
|
b7df57c9f6 | ||
|
|
f669490c58 | ||
|
|
ae5e1923ec | ||
|
|
efb86aef12 | ||
|
|
e29c946c29 | ||
|
|
8754d44167 | ||
|
|
6e1980e152 | ||
|
|
b9bf9ddce6 | ||
|
|
6644bd005f | ||
|
|
32a728d351 | ||
|
|
5fb01a3a42 | ||
|
|
70b2fca220 | ||
|
|
cf2fc66b02 | ||
|
|
4c542e6c13 | ||
|
|
4c448334bd | ||
|
|
3257d22fea | ||
|
|
837ed71c65 | ||
|
|
04c4854fdf | ||
|
|
64c88c1e16 | ||
|
|
8c92442b49 | ||
|
|
1f2f2c6b96 | ||
|
|
e20baee136 | ||
|
|
859f7fce1f | ||
|
|
45a05f3841 | ||
|
|
935625f1b8 | ||
|
|
a3e3d914ed | ||
|
|
4d5edcb4ac | ||
|
|
c8a90606c1 | ||
|
|
b4b14d2106 | ||
|
|
45a3c0e596 | ||
|
|
169a98319a | ||
|
|
0f557756dd | ||
|
|
fd0fc20d35 | ||
|
|
c00f5e6531 | ||
|
|
b71a503844 | ||
|
|
91996e7ee5 | ||
|
|
41c69766a4 | ||
|
|
19592519c2 | ||
|
|
74988eed99 | ||
|
|
2870178720 | ||
|
|
cc69950b15 | ||
|
|
ed7e3bc70a | ||
|
|
40bd84d3e3 | ||
|
|
38d97557da | ||
|
|
2139c2c2de | ||
|
|
99fdf5916e | ||
|
|
9e54d9d692 | ||
|
|
0510b47894 | ||
|
|
e5b27b9916 | ||
|
|
1ba3314335 | ||
|
|
dfc2e3a2ac | ||
|
|
d011da9d1a | ||
|
|
1127163996 | ||
|
|
b52c4fcbcd | ||
|
|
4e92cd172a | ||
|
|
bddf8140e4 | ||
|
|
f151e048ed | ||
|
|
b73a108543 | ||
|
|
289cb0f77c | ||
|
|
3462efa386 | ||
|
|
1baeae4270 | ||
|
|
0f8c1ee76d | ||
|
|
141072a838 | ||
|
|
99fe18503a | ||
|
|
236ae06e0b | ||
|
|
cc7b000d2c | ||
|
|
98102648cb | ||
|
|
9026562c79 | ||
|
|
08f08858f3 | ||
|
|
a820aab9da | ||
|
|
2c43fb49d6 | ||
|
|
ad790bea2e | ||
|
|
47fb17b108 | ||
|
|
ea24847620 | ||
|
|
246cb03e26 | ||
|
|
3847a6fcb6 | ||
|
|
137f22ad36 | ||
|
|
268e801cb1 | ||
|
|
791f07e4f0 | ||
|
|
c97b8bbf82 | ||
|
|
787593b708 | ||
|
|
c793885b76 | ||
|
|
f8258325b4 | ||
|
|
a72bab1b9a | ||
|
|
1118fca75d | ||
|
|
9b0df97a42 | ||
|
|
2eb6a541a9 | ||
|
|
ae04110032 | ||
|
|
962706d16c | ||
|
|
fb09f1341f | ||
|
|
cb97fd3097 | ||
|
|
bf5a802f5a | ||
|
|
f6430e3fe2 | ||
|
|
88b5df91f6 | ||
|
|
19b4fa17d3 | ||
|
|
1f6b842af4 | ||
|
|
d1b1866a3a | ||
|
|
6b5597f7d8 | ||
|
|
5af0db88fa | ||
|
|
701460ba84 | ||
|
|
b20bcbc363 | ||
|
|
3c42f64e6e | ||
|
|
6531719da5 | ||
|
|
bcf2e10ae7 | ||
|
|
69dee5c732 | ||
|
|
5dd1ef90ca | ||
|
|
11507c0e1b | ||
|
|
e77077edeb | ||
|
|
ea592e6b6c | ||
|
|
62554efffe | ||
|
|
7212829435 | ||
|
|
6c9db02ff7 | ||
|
|
f9d1d1f36f | ||
|
|
e9b8193b24 | ||
|
|
f96df64cb2 | ||
|
|
04db3d0f7a | ||
|
|
d6e81f0bfd | ||
|
|
73bf238507 | ||
|
|
5bf8032112 | ||
|
|
97a8483143 | ||
|
|
34fb42970a | ||
|
|
974c46b89b | ||
|
|
be11b354f4 | ||
|
|
8f221bdec0 | ||
|
|
68c3d09c2c | ||
|
|
bc6ddb7f45 | ||
|
|
83626ef97a | ||
|
|
589f8107e8 | ||
|
|
6043a2d6f7 | ||
|
|
33382dc7ee | ||
|
|
798e707eb3 | ||
|
|
d6bc266ba0 | ||
|
|
b2429259af | ||
|
|
ee0ca6470d | ||
|
|
2d9836a579 | ||
|
|
9b8d8cac04 | ||
|
|
4dedccd8e2 | ||
|
|
ad787626a4 | ||
|
|
d21612401f | ||
|
|
6c3b70e9a5 | ||
|
|
d057d767cc | ||
|
|
ea642026eb | ||
|
|
54ca2e7f8c | ||
|
|
6b85926104 | ||
|
|
f59b201f19 | ||
|
|
5b3e1ded35 | ||
|
|
7ba70a5fed | ||
|
|
d3ae4fe2d2 | ||
|
|
35713efa02 | ||
|
|
7f090ac16a | ||
|
|
643c9c9b47 | ||
|
|
df4d0a73d2 | ||
|
|
c6ce03e45e | ||
|
|
6738d19fb8 | ||
|
|
279ba58edb | ||
|
|
2513da4b4c | ||
|
|
435e812c09 | ||
|
|
98ef183ed0 | ||
|
|
127273327b | ||
|
|
5ac5f313bd | ||
|
|
fe3d53f443 | ||
|
|
4b42056042 | ||
|
|
090fef553d | ||
|
|
befdc10c32 | ||
|
|
31c3646757 | ||
|
|
919ead1157 | ||
|
|
3070883bcf | ||
|
|
4371af3e19 | ||
|
|
95ee9efa57 | ||
|
|
5a18d7a0df | ||
|
|
ee76a5ae5a | ||
|
|
58b0003975 | ||
|
|
a4c55eefd0 | ||
|
|
6e64aba47f | ||
|
|
e2dcf3cc54 | ||
|
|
8dca5ae5ec | ||
|
|
49782c5499 | ||
|
|
06d309fd7a | ||
|
|
ff83c00715 | ||
|
|
b4e4788c44 | ||
|
|
2ef8809ef3 | ||
|
|
9090a21de0 | ||
|
|
4e407b8777 | ||
|
|
4ea7f3467d | ||
|
|
bb79e5764b | ||
|
|
5fe6d2134b | ||
|
|
9322b43d65 | ||
|
|
5b529bbc94 | ||
|
|
8cfb648761 | ||
|
|
09d7ffabcd | ||
|
|
ed5aabe8b7 | ||
|
|
37e1d7c776 | ||
|
|
821f13fd79 | ||
|
|
c3fa86867b | ||
|
|
2bd299f731 | ||
|
|
9c37d95627 | ||
|
|
2688023c7f | ||
|
|
0be5b9e6b0 | ||
|
|
008eb1461c | ||
|
|
77bf9245d2 | ||
|
|
8b104d7893 | ||
|
|
e324f82d3c | ||
|
|
398f56dbc8 | ||
|
|
c8e55a6fd4 | ||
|
|
01f42b836c | ||
|
|
cb981e39c2 | ||
|
|
710284cbc4 | ||
|
|
ac4d9fd055 | ||
|
|
63934ea71e | ||
|
|
cdf72523f3 | ||
|
|
6229e42ae5 | ||
|
|
1e4273d881 | ||
|
|
04c0497ed7 | ||
|
|
48f835efbf | ||
|
|
631ed7288c | ||
|
|
ad148c5ac2 | ||
|
|
ca51458081 | ||
|
|
e2b7392b96 | ||
|
|
2885f62816 | ||
|
|
6b39c81957 | ||
|
|
276d19feaa | ||
|
|
eac822e897 | ||
|
|
d20bebfe13 | ||
|
|
5b2c30d7e6 | ||
|
|
84f565ec71 | ||
|
|
869ca9b733 | ||
|
|
6c30014600 | ||
|
|
4072b27870 | ||
|
|
47461368ca | ||
|
|
f46da1da7d | ||
|
|
f19c94b555 | ||
|
|
dfc07f038b | ||
|
|
efd0e7222b | ||
|
|
7bcd55c264 | ||
|
|
77c202a2e6 | ||
|
|
b6a41ad5ba | ||
|
|
d2b47e8065 | ||
|
|
36239fee36 |
No files matched your search
+1
-7
@@ -8,12 +8,6 @@ branches:
|
||||
- PHP-5.6
|
||||
- PHP-7.0
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- NEWS
|
||||
- UPGRADING*
|
||||
- README.*
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
cache:
|
||||
@@ -23,7 +17,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.8
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -16,9 +16,11 @@ define ____executor_globals
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
set $eg_ptr = $eg
|
||||
else
|
||||
set $eg = executor_globals
|
||||
set $cg = compiler_globals
|
||||
set $eg_ptr = (zend_executor_globals*) &executor_globals
|
||||
end
|
||||
end
|
||||
|
||||
@@ -289,6 +291,16 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define print_global_vars
|
||||
____executor_globals
|
||||
set $symtable = ((HashTable *)&($eg_ptr->symbol_table))
|
||||
print_ht $symtable
|
||||
end
|
||||
|
||||
document print_global_vars
|
||||
Prints the global variables
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
|
||||
@@ -274,6 +274,7 @@ sapi/fpm/fpm/php-cgi
|
||||
sapi/phpdbg/phpdbg_parser.c
|
||||
sapi/phpdbg/phpdbg_parser.h
|
||||
sapi/phpdbg/phpdbg
|
||||
sapi/phpdbg/phpdbg.1
|
||||
scripts/php-config
|
||||
scripts/phpize
|
||||
scripts/man1/*.1
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
@@ -47,6 +47,8 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_script:
|
||||
# Enable IPv6
|
||||
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
# Setup Extensions
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
|
||||
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
|
||||
rm -f ext/phar/phar.phar ext/phar/phar.php
|
||||
|
||||
@@ -1,6 +1,218 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.1.16
|
||||
13 Sep 2018, PHP 7.1.22
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76754 (parent private constant in extends class memory leak).
|
||||
(Laruence)
|
||||
. Fixed bug #72443 (Generate enabled extension). (petk)
|
||||
|
||||
- Apache2:
|
||||
. Fixed bug #76582 (Apache bucket brigade sometimes becomes invalid). (stas)
|
||||
|
||||
- Bz2:
|
||||
. Fixed arginfo for bzcompress. (Tyson Andre)
|
||||
|
||||
- gettext:
|
||||
. Fixed bug #76517 (incorrect restoring of LDFLAGS). (sji)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #68180 (iconv_mime_decode can return extra characters in a
|
||||
header). (cmb)
|
||||
. Fixed bug #63839 (iconv_mime_decode_headers function is skipping headers).
|
||||
(cmb)
|
||||
. Fixed bug #60494 (iconv_mime_decode does ignore special characters). (cmb)
|
||||
. Fixed bug #55146 (iconv_mime_decode_headers() skips some headers). (cmb)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74484 (MessageFormatter::formatMessage memory corruption with
|
||||
11+ named placeholders). (Anatol)
|
||||
|
||||
- libxml:
|
||||
. Fixed bug #76777 ("public id" parameter of libxml_set_external_entity_loader
|
||||
callback undefined). (Ville Hukkamäki)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76704 (mb_detect_order return value varies based on argument
|
||||
type). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
|
||||
file). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #76705 (unusable ssl => peer_fingerprint in
|
||||
stream_context_create()). (Jakub Zelenka)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76595 (phpdbg man page contains outdated information).
|
||||
(Kevin Abel)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #68825 (Exception in DirectoryIterator::getLinkTarget()). (cmb)
|
||||
. Fixed bug #68175 (RegexIterator pregFlags are NULL instead of 0). (Tim
|
||||
Siebels)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76778 (array_reduce leaks memory if callback throws exception).
|
||||
(cmb)
|
||||
|
||||
- zlib:
|
||||
. Fixed bug #65988 (Zlib version check fails when an include/zlib/ style dir
|
||||
is passed to the --with-zlib configure option). (Jay Bonci)
|
||||
. Fixed bug #76709 (Minimal required zlib library is 1.2.0.4). (petk)
|
||||
|
||||
16 Aug 2018, PHP 7.1.21
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #52974 (jewish.c: compile error under Windows with GBK charset).
|
||||
(cmb)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #76366 (References in sub-array for filtering breaks the filter).
|
||||
(ZiHang Gao)
|
||||
|
||||
- PDO_Firebird:
|
||||
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #75402 (Possible Memory Leak using PDO::CURSOR_SCROLL option).
|
||||
(Anatol)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #68553 (array_column: null values in $index_key become incrementing
|
||||
keys in result). (Laruence)
|
||||
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
|
||||
. Fixed bug #76643 (Segmentation fault when using `output_add_rewrite_var`).
|
||||
(cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
|
||||
(Timur Ibragimov)
|
||||
|
||||
07 Jul 2018, PHP 7.1.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76534 (PHP hangs on 'illegal string offset on string references
|
||||
with an error handler). (Laruence)
|
||||
. Fixed bug #76502 (Chain of mixed exceptions and errors does not serialize
|
||||
properly). (Nikita)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #76462 (Undefined property: DateInterval::$f). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
|
||||
non-blocking). (Nikita)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #74670 (Integer Underflow when unserializing GMP and possible
|
||||
other classes). (Nikita)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76556 (get_debug_info handler for BreakIterator shows wrong
|
||||
type). (cmb)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76532 (Integer overflow and excessive memory usage
|
||||
in mb_strimwidth). (MarcusSchwarz)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #76548 (pg_fetch_result did not fetch the next row). (Anatol)
|
||||
|
||||
- phpdbg:
|
||||
. Fix arginfo wrt. optional/required parameters. (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #76536 (PHP crashes with core dump when throwing exception in
|
||||
error handler). (Laruence)
|
||||
. Fixed bug #75231 (ReflectionProperty#getValue() incorrectly works with
|
||||
inherited classes). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys).
|
||||
(Laruence)
|
||||
. Fixed bug #71848 (getimagesize with $imageinfo returns false). (cmb)
|
||||
|
||||
22 Jun 2018, PHP 7.1.19
|
||||
|
||||
- CLI Server:
|
||||
. Fixed bug #76333 (PHP built-in server does not find files if root path
|
||||
contains special characters). (Anatol)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #76296 (openssl_pkey_get_public does not respect open_basedir).
|
||||
(Erik Lax, Jakub Zelenka)
|
||||
. Fixed bug #76174 (openssl extension fails to build with LibreSSL 2.7).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #76367 (NoRewindIterator segfault 11). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76335 ("link(): Bad file descriptor" with non-ASCII path).
|
||||
(Anatol)
|
||||
. Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT). (Bob)
|
||||
|
||||
24 May 2018, PHP 7.1.18
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #76075 --with-fpm-acl wrongly tries to find libacl on FreeBSD.
|
||||
(mgorny)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74385 (Locale::parseLocale() broken with some arguments).
|
||||
(Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp). (Dmitry)
|
||||
. Fixed bug #76275 (Assertion failure in file cache when unserializing empty
|
||||
try_catch_array). (Nikita)
|
||||
. Fixed bug #76281 (Opcache causes incorrect "undefined variable" errors).
|
||||
(Nikita)
|
||||
|
||||
- Reflection:
|
||||
. Fixed arginfo for array_replace(_recursive) and array_merge(_recursive).
|
||||
(carusogabriel)
|
||||
|
||||
|
||||
26 Apr 2018, PHP 7.1.17
|
||||
|
||||
- Date:
|
||||
. Fixed bug #76131 (mismatch arginfo for date_create). (carusogabriel)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #68440 (ERROR: failed to reload: execvp() failed: Argument list
|
||||
too long). (Jacob Hipps)
|
||||
. Fixed incorrect write to getenv result in FPM reload. (Jakub Zelenka)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #52070 (imagedashedline() - dashed line sometimes is not visible).
|
||||
(cmb)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #76153 (Intl compilation fails with icu4c 61.1). (Anatol)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
|
||||
. Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
|
||||
(chrullrich, cmb)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76143 (Memory corruption: arbitrary NUL overwrite). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #76131 (mismatch arginfo for splarray constructor).
|
||||
(carusogabriel)
|
||||
|
||||
- standard:
|
||||
. Fixed bug #75996 (incorrect url in header for mt_rand). (tatarbj)
|
||||
|
||||
29 Mar 2018, PHP 7.1.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #76025 (Segfault while throwing exception in error_handler).
|
||||
@@ -8,6 +220,10 @@ PHP NEWS
|
||||
. Fixed bug #76044 ('date: illegal option -- -' in ./configure on FreeBSD).
|
||||
(Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #75605 (Dumpable FPM child processes allow bypassing opcache
|
||||
access controls). (Jakub Zelenka)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73957 (signed integer conversion in imagescale()). (cmb)
|
||||
|
||||
|
||||
+3
-3
@@ -70,7 +70,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
@@ -79,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
@@ -90,7 +90,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
|
||||
@@ -20,7 +20,7 @@ assert(0 && ($a = function () {
|
||||
yield from $x;
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = "aaa";
|
||||
@@ -161,7 +161,7 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
yield from $x;
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
|
||||
abstract class A extends B implements C, D {
|
||||
const X = 12;
|
||||
const Y = self::X, Z = 'aaa';
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #76383: array_map on $GLOBALS returns IS_INDIRECT
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 1;
|
||||
array_map(function($x) use (&$lastval) { $lastval = $x; }, $GLOBALS);
|
||||
var_dump(gettype($lastval), $lastval); // will contain $a
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(7) "integer"
|
||||
int(1)
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #76502: Chain of mixed exceptions and errors does not serialize properly
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$examples = [
|
||||
"Exception(Exception())" => new Exception("outer", 0, new Exception("inner")),
|
||||
"Error(Error())" => new Error("outer", 0, new Error("inner")),
|
||||
"Error(Exception())" => new Error("outer", 0, new Exception("inner")),
|
||||
"Exception(Error())" => new Exception("outer", 0, new Error("inner"))
|
||||
];
|
||||
|
||||
foreach ($examples as $name => $example) {
|
||||
$processed = unserialize(serialize($example));
|
||||
$processedPrev = $processed->getPrevious();
|
||||
echo "---- $name ----\n";
|
||||
echo "before: ", get_class($example), ".previous == ",
|
||||
get_class($example->getPrevious()), "\n";
|
||||
echo "after : ", get_class($processed), ".previous == ",
|
||||
$processedPrev ? get_class($processedPrev) : "null", "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
---- Exception(Exception()) ----
|
||||
before: Exception.previous == Exception
|
||||
after : Exception.previous == Exception
|
||||
---- Error(Error()) ----
|
||||
before: Error.previous == Error
|
||||
after : Error.previous == Error
|
||||
---- Error(Exception()) ----
|
||||
before: Error.previous == Exception
|
||||
after : Error.previous == Exception
|
||||
---- Exception(Error()) ----
|
||||
before: Exception.previous == Error
|
||||
after : Exception.previous == Error
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function ($severity, $message, $file, $line) {
|
||||
throw new \Exception($message);
|
||||
});
|
||||
|
||||
$x = "foo";
|
||||
$y = &$x["bar"];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug76534.php on line %d
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76754 (parent private constant in extends class memory leak)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FOO
|
||||
{
|
||||
private const FOO = 'BAR';
|
||||
}
|
||||
|
||||
class BAR extends FOO { }
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -2810,6 +2810,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {
|
||||
key = zend_string_alloc(class_name_length, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(key), class_name, class_name_length);
|
||||
disabled_class = zend_hash_find_ptr(CG(class_table), key);
|
||||
zend_string_release(key);
|
||||
if (!disabled_class) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
+8
-1
@@ -195,7 +195,14 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
|
||||
#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
|
||||
#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset))
|
||||
#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr))
|
||||
#define pefree_size(ptr, size, persistent) ((persistent)?free(ptr):efree_size(ptr, size))
|
||||
#define pefree_size(ptr, size, persistent) do { \
|
||||
if (persistent) { \
|
||||
free(ptr); \
|
||||
} else { \
|
||||
efree_size(ptr, size);\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
|
||||
#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size)))
|
||||
#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size)))
|
||||
|
||||
@@ -1080,6 +1080,9 @@ tail_call:
|
||||
zend_ast_export_ex(str, decl->child[1], 0, indent);
|
||||
if (decl->child[3]) {
|
||||
smart_str_appends(str, ": ");
|
||||
if (decl->child[3]->attr & ZEND_TYPE_NULLABLE) {
|
||||
smart_str_appendc(str, '?');
|
||||
}
|
||||
zend_ast_export_ns_name(str, decl->child[3], 0, indent);
|
||||
}
|
||||
if (decl->child[2]) {
|
||||
@@ -1614,6 +1617,9 @@ simple_list:
|
||||
break;
|
||||
case ZEND_AST_PARAM:
|
||||
if (ast->child[0]) {
|
||||
if (ast->child[0]->attr & ZEND_TYPE_NULLABLE) {
|
||||
smart_str_appendc(str, '?');
|
||||
}
|
||||
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
|
||||
smart_str_appendc(str, ' ');
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ ZEND_METHOD(exception, __wakeup)
|
||||
CHECK_EXC_TYPE(ZEND_STR_TRACE, IS_ARRAY);
|
||||
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
|
||||
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
|
||||
!instanceof_function(Z_OBJCE_P(pvalue), zend_ce_throwable) ||
|
||||
pvalue == object)) {
|
||||
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
|
||||
}
|
||||
|
||||
+9
-4
@@ -1042,9 +1042,12 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
|
||||
zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
|
||||
zend_class_entry *ce = NULL;
|
||||
|
||||
if (UNEXPECTED(ret_info->type_hint == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
|
||||
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
|
||||
return 0;
|
||||
if (ret_info->type_hint == IS_VOID) {
|
||||
if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) {
|
||||
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!zend_check_internal_type(zf, ret_info, ret, &ce, 1))) {
|
||||
@@ -1700,7 +1703,9 @@ fetch_from_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, type);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
ZVAL_ERROR(result);
|
||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
|
||||
|
||||
+1
-1
@@ -296,8 +296,8 @@ ZEND_API void destroy_zend_class(zval *zv)
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
zend_hash_destroy(&ce->constants_table);
|
||||
}
|
||||
zend_hash_destroy(&ce->constants_table);
|
||||
if (ce->num_interfaces > 0 && ce->interfaces) {
|
||||
efree(ce->interfaces);
|
||||
}
|
||||
|
||||
+3
-1
@@ -891,7 +891,9 @@ ZEND_VM_C_LABEL(assign_dim_op_convert_to_array):
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
ZEND_VM_C_GOTO(assign_dim_op_convert_to_array);
|
||||
|
||||
+24
-8
@@ -17596,7 +17596,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -21014,7 +21016,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -22385,7 +22389,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -25330,7 +25336,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -37055,7 +37063,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -41665,7 +41675,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -44149,7 +44161,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
@@ -48220,7 +48234,9 @@ assign_dim_op_convert_to_array:
|
||||
zend_throw_error(NULL, "[] operator not supported for strings");
|
||||
} else {
|
||||
zend_check_string_offset(dim, BP_VAR_RW);
|
||||
zend_wrong_string_offset();
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_wrong_string_offset();
|
||||
}
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
|
||||
goto assign_dim_op_convert_to_array;
|
||||
|
||||
@@ -2248,6 +2248,9 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
+5
-5
@@ -75,7 +75,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#if HAVE_DECL_ISNAN
|
||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
@@ -84,7 +84,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISINF
|
||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
@@ -95,7 +95,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_DECL_ISFINITE
|
||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=16
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=22
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ if(!extension_loaded("bcmath")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip valid only for windows');
|
||||
}
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) >= 0) {
|
||||
echo "skip Only for Windows systems < $req";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -14,5 +19,4 @@ var_dump(bcpowmod(1, 1.2, 1, 1));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "1"
|
||||
string(3) "0.0"
|
||||
bc math warning: non-zero scale in exponent
|
||||
%Astring(3) "0.0"%A
|
||||
@@ -4,7 +4,11 @@ Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
|
||||
<?php
|
||||
if(!extension_loaded("bcmath")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip Not valid for windows');
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) < 0) {
|
||||
echo "skip Compatible on Windows systems >= $req";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -6,6 +6,11 @@ if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip valid only for windows');
|
||||
}
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) >= 0) {
|
||||
echo "skip Only for Windows systems < $req";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -13,9 +18,7 @@ var_dump(bcpowmod('4.1', '4', '3', 3));
|
||||
var_dump(bcpowmod('4', '4', '3.1', 3));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(5) "1.000"
|
||||
string(5) "1.000"
|
||||
===DONE===
|
||||
bc math warning: non-zero scale in base
|
||||
bc math warning: non-zero scale in modulus
|
||||
--EXPECTF--
|
||||
%Astring(5) "1.000"
|
||||
%Astring(5) "1.000"
|
||||
===DONE===%A
|
||||
@@ -4,7 +4,11 @@ Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip Not valid for windows');
|
||||
$cur = PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
|
||||
$req = "10.0.17134";
|
||||
if (version_compare($cur, $req) < 0) {
|
||||
echo "skip Compatible on Windows systems >= $req";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_bzerror, 0)
|
||||
ZEND_ARG_INFO(0, bz)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzcompress, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_bzcompress, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, source)
|
||||
ZEND_ARG_INFO(0, blocksize)
|
||||
ZEND_ARG_INFO(0, workfactor)
|
||||
|
||||
+25
-25
@@ -340,38 +340,38 @@ char *JewishMonthName[14] =
|
||||
char *JewishMonthHebNameLeap[14] =
|
||||
{
|
||||
"",
|
||||
"תשרי",
|
||||
"חשון",
|
||||
"כסלו",
|
||||
"טבת",
|
||||
"שבט",
|
||||
"אדר א'",
|
||||
"אדר ב'",
|
||||
"ניסן",
|
||||
"אייר",
|
||||
"סיון",
|
||||
"תמוז",
|
||||
"אב",
|
||||
"אלול"
|
||||
"\xFA\xF9\xF8\xE9",
|
||||
"\xE7\xF9\xE5\xEF",
|
||||
"\xEB\xF1\xEC\xE5",
|
||||
"\xE8\xE1\xFA",
|
||||
"\xF9\xE1\xE8",
|
||||
"\xE0\xE3\xF8 \xE0'",
|
||||
"\xE0\xE3\xF8 \xE1'",
|
||||
"\xF0\xE9\xF1\xEF",
|
||||
"\xE0\xE9\xE9\xF8",
|
||||
"\xF1\xE9\xe5\xEF",
|
||||
"\xFA\xEE\xE5\xE6",
|
||||
"\xE0\xE1",
|
||||
"\xE0\xEC\xE5\xEC"
|
||||
};
|
||||
|
||||
/* names for regular year */
|
||||
char *JewishMonthHebName[14] =
|
||||
{
|
||||
"",
|
||||
"תשרי",
|
||||
"חשון",
|
||||
"כסלו",
|
||||
"טבת",
|
||||
"שבט",
|
||||
"\xFA\xF9\xF8\xE9",
|
||||
"\xE7\xF9\xE5\xEF",
|
||||
"\xEB\xF1\xEC\xE5",
|
||||
"\xE8\xE1\xFA",
|
||||
"\xF9\xE1\xE8",
|
||||
"",
|
||||
"אדר",
|
||||
"ניסן",
|
||||
"אייר",
|
||||
"סיון",
|
||||
"תמוז",
|
||||
"אב",
|
||||
"אלול"
|
||||
"\xE0\xE3\xF8",
|
||||
"\xF0\xE9\xF1\xEF",
|
||||
"\xE0\xE9\xE9\xF8",
|
||||
"\xF1\xE9\xE5\xEF",
|
||||
"\xFA\xEE\xE5\xE6",
|
||||
"\xE0\xE1",
|
||||
"\xE0\xEC\xE5\xEC"
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Test all hebrew month names
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip calendar extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
for ($year = 5000; $year <= 5001; $year++) {
|
||||
$leap = ($year === 5001) ? 'leap' : 'normal';
|
||||
echo "$leap year $year\n";
|
||||
for ($month = 1; $month <= 13; $month++) {
|
||||
$jd = jewishtojd($month, 1, $year);
|
||||
$hebrew = jdtojewish($jd, true);
|
||||
$hex = bin2hex($hebrew);
|
||||
echo "$hex\n";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
normal year 5000
|
||||
e020faf9f8e920e4
|
||||
e020e7f9e5ef20e4
|
||||
e020ebf1ece520e4
|
||||
e020e8e1fa20e4
|
||||
e020f9e1e820e4
|
||||
e020e0e3f820e02720e4
|
||||
e020e0e3f820e12720e4
|
||||
e020f0e9f1ef20e4
|
||||
e020e0e9e9f820e4
|
||||
e020f1e9e5ef20e4
|
||||
e020faeee5e620e4
|
||||
e020e0e120e4
|
||||
e020e0ece5ec20e4
|
||||
|
||||
leap year 5001
|
||||
e020faf9f8e920e4e0
|
||||
e020e7f9e5ef20e4e0
|
||||
e020ebf1ece520e4e0
|
||||
e020e8e1fa20e4e0
|
||||
e020f9e1e820e4e0
|
||||
e020e0e3f820e4e0
|
||||
e020e0e3f820e4e0
|
||||
e020f0e9f1ef20e4e0
|
||||
e020e0e9e9f820e4e0
|
||||
e020f1e9e5ef20e4e0
|
||||
e020faeee5e620e4e0
|
||||
e020e0e120e4e0
|
||||
e020e0ece5ec20e4e0
|
||||
|
||||
===DONE===
|
||||
@@ -82,7 +82,7 @@ static void com_iter_get_key(zend_object_iterator *iter, zval *key)
|
||||
}
|
||||
}
|
||||
|
||||
static int com_iter_move_forwards(zend_object_iterator *iter)
|
||||
static void com_iter_move_forwards(zend_object_iterator *iter)
|
||||
{
|
||||
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
|
||||
unsigned long n_fetched;
|
||||
@@ -103,18 +103,18 @@ static int com_iter_move_forwards(zend_object_iterator *iter)
|
||||
} else {
|
||||
/* indicate that there are no more items */
|
||||
I->key = (ulong)-1;
|
||||
return FAILURE;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
/* safe array */
|
||||
if (I->key >= (ULONG) I->sa_max) {
|
||||
I->key = (ulong)-1;
|
||||
return FAILURE;
|
||||
return;
|
||||
}
|
||||
I->key++;
|
||||
if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key) == 0) {
|
||||
I->key = (ulong)-1;
|
||||
return FAILURE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,6 @@ static int com_iter_move_forwards(zend_object_iterator *iter)
|
||||
php_com_zval_from_variant(&ptr, &I->v, I->code_page);
|
||||
/* php_com_wrap_variant(ptr, &I->v, I->code_page); */
|
||||
ZVAL_COPY_VALUE(&I->zdata, &ptr);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -514,15 +514,13 @@ static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key)
|
||||
}
|
||||
}
|
||||
|
||||
static int saproxy_iter_move_forwards(zend_object_iterator *iter)
|
||||
static void saproxy_iter_move_forwards(zend_object_iterator *iter)
|
||||
{
|
||||
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
|
||||
|
||||
if (++I->key >= I->imax) {
|
||||
I->key = -1;
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static zend_object_iterator_funcs saproxy_iter_funcs = {
|
||||
|
||||
@@ -223,9 +223,9 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
}
|
||||
|
||||
/* Type-library stuff */
|
||||
void php_com_typelibrary_dtor(void *pDest)
|
||||
void php_com_typelibrary_dtor(zval *pDest)
|
||||
{
|
||||
ITypeLib **Lib = (ITypeLib**)pDest;
|
||||
ITypeLib **Lib = (ITypeLib**)Z_PTR_P(pDest);
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
|
||||
@@ -1012,13 +1012,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
|
||||
tzset();
|
||||
ttstamp = timestamp;
|
||||
tmv = localtime(&ttstamp);
|
||||
#if ZEND_ENABLE_ZVAL_LONG64
|
||||
|
||||
/* Invalid after 23:59:59, December 31, 3000, UTC */
|
||||
if (!tmv) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&systime, 0, sizeof(systime));
|
||||
|
||||
systime.wDay = tmv->tm_mday;
|
||||
|
||||
@@ -174,7 +174,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage);
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
int codepage);
|
||||
void php_com_typelibrary_dtor(void *pDest);
|
||||
void php_com_typelibrary_dtor(zval *pDest);
|
||||
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink);
|
||||
int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage);
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ Bug #72498 variant_date_from_timestamp null dereference
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
|
||||
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
+1
-1
@@ -332,7 +332,7 @@ PHP_FUNCTION(curl_multi_info_read)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (zmsgs_in_queue) {
|
||||
zval_dtor(zmsgs_in_queue);
|
||||
zval_ptr_dtor(zmsgs_in_queue);
|
||||
ZVAL_LONG(zmsgs_in_queue, queued_msgs);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ echo "Ok\n";
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
Hello World!
|
||||
Hello World!Ok
|
||||
%A
|
||||
Hello World!
|
||||
Hello World!* Closing connection 0
|
||||
Ok
|
||||
|
||||
@@ -65,4 +65,3 @@ Hello World!Ok for CURLOPT_FILE
|
||||
|
||||
%AOk for CURLOPT_INFILE
|
||||
===DONE===
|
||||
%A
|
||||
@@ -13,17 +13,23 @@ function curl_cli_server_start() {
|
||||
$doc_root = __DIR__;
|
||||
$router = "responder/get.php";
|
||||
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => array("pipe", "w"),
|
||||
);
|
||||
|
||||
$cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS;
|
||||
$cmd .= " {$router}";
|
||||
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
|
||||
} else {
|
||||
$descriptorspec = array(
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
);
|
||||
|
||||
$cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS;
|
||||
$cmd .= " {$router}";
|
||||
$cmd .= " 2>/dev/null";
|
||||
|
||||
+1414
-1405
File diff suppressed because it is too large.
Load diff
+6
-5
@@ -161,7 +161,7 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, time)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_ARG_INFO(0, timezone)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
|
||||
@@ -2021,9 +2021,9 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
@@ -2041,7 +2041,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2390,7 +2390,7 @@ static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp
|
||||
|
||||
*is_temp = 1;
|
||||
ht = zend_array_dup(props);
|
||||
|
||||
|
||||
ZVAL_LONG(&zv, tzobj->type);
|
||||
zend_hash_str_update(ht, "timezone_type", sizeof("timezone_type")-1, &zv);
|
||||
|
||||
@@ -4276,6 +4276,7 @@ static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int
|
||||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("f", sizeof("f") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
|
||||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
|
||||
/* Fallback to read_property. */
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76462 Undefined property: DateInterval::$f
|
||||
--FILE--
|
||||
<?php
|
||||
$buggy = new DateInterval('P0Y');
|
||||
$buggy->f += 0.01;
|
||||
|
||||
$ok = new DateInterval('P0Y');
|
||||
$ok->f = $ok->f + 0.01;
|
||||
|
||||
var_dump($buggy->f);
|
||||
var_dump($ok->f);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(0.01)
|
||||
float(0.01)
|
||||
@@ -42,7 +42,11 @@ struct _notationIterator {
|
||||
xmlNotation *notation;
|
||||
};
|
||||
|
||||
static void itemHashScanner (void *payload, void *data, xmlChar *name) /* {{{ */
|
||||
#if LIBXML_VERSION >= 20908
|
||||
static void itemHashScanner (void *payload, void *data, const xmlChar *name) /* {{{ */
|
||||
#else
|
||||
static void itemHashScanner (void *payload, void *data, xmlChar *name)
|
||||
#endif
|
||||
{
|
||||
nodeIterator *priv = (nodeIterator *)data;
|
||||
|
||||
|
||||
@@ -719,7 +719,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
}
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
zval_ptr_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
|
||||
+9
-3
@@ -1704,7 +1704,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
length = (int) php_strnlen(value, length);
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
@@ -2536,7 +2536,10 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
|
||||
return;
|
||||
}
|
||||
/* Check to make sure we are not going to go past the ExifLength */
|
||||
if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) {
|
||||
if (ImageInfo->Thumbnail.size > length
|
||||
|| (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length
|
||||
|| ImageInfo->Thumbnail.offset > length - ImageInfo->Thumbnail.size
|
||||
) {
|
||||
EXIF_ERRLOG_THUMBEOF(ImageInfo)
|
||||
return;
|
||||
}
|
||||
@@ -2715,6 +2718,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
int NumDirEntries, old_motorola_intel, offset_diff;
|
||||
const maker_note_type *maker_note;
|
||||
char *dir_start;
|
||||
int data_len;
|
||||
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
|
||||
@@ -2769,6 +2773,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
switch (maker_note->offset_mode) {
|
||||
case MN_OFFSET_MAKER:
|
||||
offset_base = value_ptr;
|
||||
data_len = value_len;
|
||||
break;
|
||||
case MN_OFFSET_GUESS:
|
||||
if (maker_note->offset + 10 + 4 >= value_len) {
|
||||
@@ -2785,6 +2790,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
return FALSE;
|
||||
}
|
||||
offset_base = value_ptr + offset_diff;
|
||||
data_len = value_len - offset_diff;
|
||||
break;
|
||||
default:
|
||||
case MN_OFFSET_NORMAL:
|
||||
@@ -2798,7 +2804,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value)
|
||||
--DESCRIPTION--
|
||||
This test is meant to exhibit memory issues with the `-m` option. Since a lot of
|
||||
notices and warnings are to be expected anyway, we suppress these, since the are
|
||||
not relevant for this test.
|
||||
--INI--
|
||||
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76130_1.jpg');
|
||||
exif_read_data(__DIR__ . '/bug76130_2.jpg');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #76423 (Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . '/bug76423.jpg', 0, true, true);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Thumbnail goes IFD boundary or end of file reached in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(%s.jpg): Invalid JPEG file in %s on line %d
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -0,0 +1,79 @@
|
||||
--TEST--
|
||||
Bug 76557 (heap-buffer-overflow (READ of size 48) while reading exif data)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(count(exif_read_data(dirname(__FILE__) . "/bug76557.jpg")));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x010F=Make ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x8769=Exif_IFD_Po): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x927C=MakerNote ): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Invalid JPEG file in %sbug76557.php on line %d
|
||||
int(1)
|
||||
DONE
|
||||
+3
-3
@@ -120,9 +120,9 @@ dnl [ --with-$extname Include $extname support])
|
||||
|
||||
dnl Otherwise use enable:
|
||||
|
||||
dnl PHP_ARG_ENABLE($extname, whether to enable $extname support,
|
||||
PHP_ARG_ENABLE($extname, whether to enable $extname support,
|
||||
dnl Make sure that the comment is aligned:
|
||||
dnl [ --enable-$extname Enable $extname support])
|
||||
[ --enable-$extname Enable $extname support])
|
||||
|
||||
if test "\$PHP_$EXTNAME" != "no"; then
|
||||
dnl Write more examples of tests here...
|
||||
@@ -179,7 +179,7 @@ cat >config.w32 <<eof
|
||||
// ARG_WITH("$extname", "for $extname support", "no");
|
||||
|
||||
// Otherwise, use ARG_ENABLE
|
||||
// ARG_ENABLE("$extname", "enable $extname support", "no");
|
||||
ARG_ENABLE("$extname", "enable $extname support", "no");
|
||||
|
||||
if (PHP_$EXTNAME != "no") {
|
||||
EXTENSION("$extname", "$extname.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
||||
|
||||
@@ -621,6 +621,9 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
|
||||
}
|
||||
|
||||
if ((option = zend_hash_str_find(HASH_OF(filter_args), "options", sizeof("options") - 1)) != NULL) {
|
||||
/* avoid reference type */
|
||||
ZVAL_DEREF(option);
|
||||
|
||||
if (filter != FILTER_CALLBACK) {
|
||||
if (Z_TYPE_P(option) == IS_ARRAY) {
|
||||
options = option;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76366 (references in sub-array for filtering breaks the filter)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('filter')) die('skip filter extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
#array to filter
|
||||
$data = ['foo' => 6];
|
||||
|
||||
#filter args
|
||||
$args = [
|
||||
'foo'=> [
|
||||
'filter' => FILTER_VALIDATE_INT,
|
||||
'flags' => FILTER_FORCE_ARRAY
|
||||
]
|
||||
];
|
||||
|
||||
$args['foo']['options'] = [];
|
||||
|
||||
#create reference
|
||||
$options = &$args['foo']['options'];
|
||||
|
||||
#set options
|
||||
$options['min_range'] = 1;
|
||||
$options['max_range'] = 5;
|
||||
|
||||
#show the filter result
|
||||
var_dump(filter_var_array($data, $args));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
bool(false)
|
||||
}
|
||||
}
|
||||
@@ -1392,7 +1392,6 @@ void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color
|
||||
} else {
|
||||
wid = 1;
|
||||
}
|
||||
wid = (int)(thick * sin(atan2(dy, dx)));
|
||||
vert = 1;
|
||||
|
||||
d = 2 * dy - dx;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(1200, 800);
|
||||
$background_color = imagecolorallocate($im, 40, 40, 40);
|
||||
$color = imagecolorallocate($im, 255, 255, 255);
|
||||
imagedashedline($im, 800, 400, 300, 400, $color);
|
||||
imagedashedline($im, 800, 400, 300, 800, $color);
|
||||
imagedashedline($im, 800, 400, 400, 800, $color);
|
||||
imagedashedline($im, 800, 400, 500, 800, $color);
|
||||
imagedashedline($im, 800, 400, 600, 800, $color);
|
||||
imagedashedline($im, 800, 400, 700, 800, $color);
|
||||
imagedashedline($im, 800, 400, 800, 800, $color);
|
||||
include_once __DIR__ . '/func.inc';
|
||||
test_image_equals_file(__DIR__ . '/bug52070.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -35,10 +35,6 @@ if test "$PHP_GETTEXT" != "no"; then
|
||||
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
|
||||
PHP_SUBST(GETTEXT_SHARED_LIBADD)
|
||||
|
||||
if test -n "$GETTEXT_LIBS"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($GETTEXT_INCDIR)
|
||||
|
||||
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])])
|
||||
@@ -47,4 +43,7 @@ if test "$PHP_GETTEXT" != "no"; then
|
||||
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
|
||||
LDFLAGS=$O_LDFLAGS
|
||||
|
||||
if test -n "$GETTEXT_LIBS"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD)
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #74670: Integer Underflow when unserializing GMP and possible other classes
|
||||
--FILE--
|
||||
<?php
|
||||
$str = 'C:3:"GMP":4:{s:6666666666:""}';
|
||||
var_dump(unserialize($str));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 13 of 29 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -18,7 +18,7 @@ try {
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
try {
|
||||
unserialize('C:3:"GMP":8:{s:2:"42";}');
|
||||
unserialize('C:3:"GMP":9:{s:2:"42";}');
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
?>
|
||||
|
||||
+29
-3
@@ -466,7 +466,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
|
||||
|
||||
if (in_p != NULL) {
|
||||
while (in_left > 0) {
|
||||
out_left = buf_growth - out_left;
|
||||
out_left = buf_growth;
|
||||
smart_str_alloc(d, out_left, 0);
|
||||
|
||||
out_p = ZSTR_VAL((d)->s) + ZSTR_LEN((d)->s);
|
||||
@@ -500,7 +500,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
|
||||
}
|
||||
} else {
|
||||
for (;;) {
|
||||
out_left = buf_growth - out_left;
|
||||
out_left = buf_growth;
|
||||
smart_str_alloc(d, out_left, 0);
|
||||
|
||||
out_p = ZSTR_VAL((d)->s) + ZSTR_LEN((d)->s);
|
||||
@@ -1544,7 +1544,10 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
break;
|
||||
|
||||
default: /* first letter of a non-encoded word */
|
||||
_php_iconv_appendc(pretval, *p1, cd_pl);
|
||||
err = _php_iconv_appendc(pretval, *p1, cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
encoded_word = NULL;
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
|
||||
scan_stat = 12;
|
||||
@@ -1555,6 +1558,9 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
|
||||
case 1: /* expecting a delimiter */
|
||||
if (*p1 != '?') {
|
||||
if (*p1 == '\r' || *p1 == '\n') {
|
||||
--p1;
|
||||
}
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
@@ -1580,6 +1586,23 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
case '*': /* new style delimiter: locale id follows */
|
||||
scan_stat = 10;
|
||||
break;
|
||||
|
||||
case '\r': case '\n': /* not an encoded-word */
|
||||
--p1;
|
||||
_php_iconv_appendc(pretval, '=', cd_pl);
|
||||
_php_iconv_appendc(pretval, '?', cd_pl);
|
||||
err = _php_iconv_appendl(pretval, csname, (size_t)((p1 + 1) - csname), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
csname = NULL;
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
|
||||
scan_stat = 12;
|
||||
}
|
||||
else {
|
||||
scan_stat = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (scan_stat != 2) {
|
||||
char tmpbuf[80];
|
||||
@@ -2658,6 +2681,9 @@ static int php_iconv_stream_filter_append_bucket(
|
||||
tcnt = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
|
||||
goto out_failure;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #55146 (iconv_mime_decode_headers() skips some headers)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('iconv')) die('skip iconv extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$headers = <<< HEADERS
|
||||
X-Header-One: H4sIAAAAAAAAA+NgFlsCAAA=
|
||||
X-Header-Two: XtLePq6GTMn8G68F0
|
||||
HEADERS;
|
||||
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
|
||||
|
||||
$headers = <<< HEADERS
|
||||
X-Header-One: =
|
||||
X-Header-Two: XtLePq6GTMn8G68F0
|
||||
HEADERS;
|
||||
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["X-Header-One"]=>
|
||||
string(24) "H4sIAAAAAAAAA+NgFlsCAAA="
|
||||
["X-Header-Two"]=>
|
||||
string(17) "XtLePq6GTMn8G68F0"
|
||||
}
|
||||
array(2) {
|
||||
["X-Header-One"]=>
|
||||
string(1) "="
|
||||
["X-Header-Two"]=>
|
||||
string(17) "XtLePq6GTMn8G68F0"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #60494 (iconv_mime_decode does ignore special characters)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('iconv')) die('skip iconv extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(iconv_mime_decode('ä'));
|
||||
var_dump(iconv_mime_decode('ö'));
|
||||
var_dump(iconv_mime_decode('ß'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: iconv_mime_decode(): Detected an illegal character in input string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: iconv_mime_decode(): Detected an illegal character in input string in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: iconv_mime_decode(): Detected an illegal character in input string in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,71 @@
|
||||
--TEST--
|
||||
Bug #63839 (iconv_mime_decode_headers function is skipping headers)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('iconv')) die('skip iconv extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$headers = 'From: "xyz" <xyz@xyz.com>
|
||||
To: <xyz@xyz.com>
|
||||
Subject: Reply Is? white side-LED =? in Help
|
||||
Date: Sat, 22 Dec 2012
|
||||
Message-ID: <006f01cde00e$d9f79da0$8de6d8e0>
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/alternative;
|
||||
boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0"
|
||||
X-Mailer: Microsoft Office Outlook 12.0
|
||||
Thread-Index: Ac3gDtcH2huHjzYcQVmFJPPoWjJogA==
|
||||
Content-Language: en-us
|
||||
|
||||
';
|
||||
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
|
||||
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(10) {
|
||||
["From"]=>
|
||||
string(19) ""xyz" <xyz@xyz.com>"
|
||||
["To"]=>
|
||||
string(13) "<xyz@xyz.com>"
|
||||
["Subject"]=>
|
||||
string(35) "Reply Is? white side-LED =? in Help"
|
||||
["Date"]=>
|
||||
string(16) "Sat, 22 Dec 2012"
|
||||
["Message-ID"]=>
|
||||
string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
|
||||
["MIME-Version"]=>
|
||||
string(3) "1.0"
|
||||
["Content-Type"]=>
|
||||
string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
|
||||
["X-Mailer"]=>
|
||||
string(29) "Microsoft Office Outlook 12.0"
|
||||
["Thread-Index"]=>
|
||||
string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
|
||||
["Content-Language"]=>
|
||||
string(5) "en-us"
|
||||
}
|
||||
array(10) {
|
||||
["From"]=>
|
||||
string(19) ""xyz" <xyz@xyz.com>"
|
||||
["To"]=>
|
||||
string(13) "<xyz@xyz.com>"
|
||||
["Subject"]=>
|
||||
string(35) "Reply Is? white side-LED =? in Help"
|
||||
["Date"]=>
|
||||
string(16) "Sat, 22 Dec 2012"
|
||||
["Message-ID"]=>
|
||||
string(32) "<006f01cde00e$d9f79da0$8de6d8e0>"
|
||||
["MIME-Version"]=>
|
||||
string(3) "1.0"
|
||||
["Content-Type"]=>
|
||||
string(75) "multipart/alternative; boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0""
|
||||
["X-Mailer"]=>
|
||||
string(29) "Microsoft Office Outlook 12.0"
|
||||
["Thread-Index"]=>
|
||||
string(32) "Ac3gDtcH2huHjzYcQVmFJPPoWjJogA=="
|
||||
["Content-Language"]=>
|
||||
string(5) "en-us"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #68180 (iconv_mime_decode can return extra characters in a header)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('iconv')) die('skip iconv extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$original = "=?UTF-8?Q?=E3=80=8E=E3=80=90=E5=A4=96=E8=B3=87=E7=B3=BB=E6=88=A6=E7=95=A5=E3=82=B3=E3=83=B3=E3=82=B5=E3=83=AB=E3=81=8C=E9=9B=86=E7=B5=90=E3=80=91=E3=83=88=E3=83=83=E3=83=97=E3=82=B3=E3=83=B3=E3=82=B5=E3=83=AB=E3=82=BF=E3=83=B3=E3=83=88=E3=81=A8=E8=A9=B1=E3=81=9B=E3=82=8B=E3=82=B3=E3=83=B3=E3=82=B5=E3=83=AB=E6=A5=AD=E7=95=8C=E7=A0=94=E7=A9=B6=E3=82=BB=E3=83=9F=E3=83=8A=E3=83=BC=E3=80=8F=E3=81=B8=E3=81=AE=E3=82=A8=E3=83=B3=E3=83=88=E3=83=AA=E3=83=BC=E3=81=82=E3=82=8A=E3=81=8C=E3=81=A8=E3=81=86=E3=81=94=E3=81=96=E3=81=84=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?=";
|
||||
$decoded = iconv_mime_decode($original, ICONV_MIME_DECODE_STRICT, 'utf-8');
|
||||
var_dump($decoded);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(183) "『【外資系戦略コンサルが集結】トップコンサルタントと話せるコンサル業界研究セミナー』へのエントリーありがとうございました。"
|
||||
===DONE===
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fh = fopen('php://memory', 'rw');
|
||||
fwrite($fh, "abc");
|
||||
rewind($fh);
|
||||
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
|
||||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
|
||||
}
|
||||
$a = stream_get_contents($fh);
|
||||
var_dump(strlen($a));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
|
||||
int(3)
|
||||
DONE
|
||||
@@ -1082,6 +1082,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
|
||||
}
|
||||
}
|
||||
mail_free_errorlist(&IMAPG(imap_errorstack));
|
||||
IMAPG(imap_errorstack) = NIL;
|
||||
}
|
||||
|
||||
if (IMAPG(imap_alertstack) != NIL) {
|
||||
|
||||
@@ -167,7 +167,7 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp)
|
||||
}
|
||||
|
||||
ZVAL_STRING(&val, const_cast<char*>(typeid(*biter).name()));
|
||||
zend_hash_str_update(debug_info, "type", sizeof("type") - 1, &bio->text);
|
||||
zend_hash_str_update(debug_info, "type", sizeof("type") - 1, &val);
|
||||
|
||||
return debug_info;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ static void _breakiter_factory(const char *func_name,
|
||||
UErrorCode status = UErrorCode();
|
||||
intl_error_reset(NULL);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!",
|
||||
&locale_str, &dummy) == FAILURE) {
|
||||
spprintf(&msg, 0, "%s: bad arguments", func_name);
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
|
||||
|
||||
@@ -79,6 +79,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if (U_FAILURE(status)) {
|
||||
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
|
||||
"create instance from compiled rules", 0);
|
||||
delete rbbi;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
||||
+21
-12
@@ -9,6 +9,7 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_SETUP_ICU(INTL_SHARED_LIBADD)
|
||||
PHP_SUBST(INTL_SHARED_LIBADD)
|
||||
PHP_REQUIRE_CXX()
|
||||
INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
|
||||
if test "$icu_version" -ge "4002"; then
|
||||
icu_spoof_src=" spoofchecker/spoofchecker_class.c \
|
||||
spoofchecker/spoofchecker.c\
|
||||
@@ -20,7 +21,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
PHP_NEW_EXTENSION(intl, php_intl.c \
|
||||
intl_error.c \
|
||||
intl_convert.c \
|
||||
intl_convertcpp.cpp \
|
||||
collator/collator.c \
|
||||
collator/collator_class.c \
|
||||
collator/collator_sort.c \
|
||||
@@ -32,8 +32,6 @@ if test "$PHP_INTL" != "no"; then
|
||||
collator/collator_is_numeric.c \
|
||||
collator/collator_error.c \
|
||||
common/common_error.c \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
converter/converter.c \
|
||||
formatter/formatter.c \
|
||||
formatter/formatter_main.c \
|
||||
@@ -53,17 +51,12 @@ if test "$PHP_INTL" != "no"; then
|
||||
dateformat/dateformat_attr.c \
|
||||
dateformat/dateformat_data.c \
|
||||
dateformat/dateformat_format.c \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_parse.c \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat.c \
|
||||
msgformat/msgformat_attr.c \
|
||||
msgformat/msgformat_class.c \
|
||||
msgformat/msgformat_data.c \
|
||||
msgformat/msgformat_format.c \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
msgformat/msgformat_parse.c \
|
||||
grapheme/grapheme_string.c \
|
||||
grapheme/grapheme_util.c \
|
||||
@@ -73,6 +66,18 @@ if test "$PHP_INTL" != "no"; then
|
||||
transliterator/transliterator.c \
|
||||
transliterator/transliterator_class.c \
|
||||
transliterator/transliterator_methods.c \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
|
||||
|
||||
PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \
|
||||
common/common_enum.cpp \
|
||||
common/common_date.cpp \
|
||||
dateformat/dateformat_format_object.cpp \
|
||||
dateformat/dateformat_create.cpp \
|
||||
dateformat/dateformat_attrcpp.cpp \
|
||||
dateformat/dateformat_helpers.cpp \
|
||||
msgformat/msgformat_helpers.cpp \
|
||||
timezone/timezone_class.cpp \
|
||||
timezone/timezone_methods.cpp \
|
||||
calendar/calendar_class.cpp \
|
||||
@@ -83,10 +88,14 @@ if test "$PHP_INTL" != "no"; then
|
||||
breakiterator/breakiterator_methods.cpp \
|
||||
breakiterator/rulebasedbreakiterator_methods.cpp \
|
||||
breakiterator/codepointiterator_internal.cpp \
|
||||
breakiterator/codepointiterator_methods.cpp \
|
||||
uchar/uchar.c \
|
||||
idn/idn.c \
|
||||
$icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
|
||||
breakiterator/codepointiterator_methods.cpp"
|
||||
PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
|
||||
if test "$ext_shared" = "no"; then
|
||||
PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
|
||||
else
|
||||
PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS, shared_objects_intl, yes)
|
||||
fi
|
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/collator)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/converter)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/common)
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ if (PHP_INTL != "no") {
|
||||
ADD_FLAG("LIBS_INTL", "iculx.lib");
|
||||
}
|
||||
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc");
|
||||
ADD_FLAG("CFLAGS_INTL", "/EHsc /D U_USING_ICU_NAMESPACE=1");
|
||||
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
|
||||
} else {
|
||||
WARNING("intl not enabled; libraries and/or headers not found");
|
||||
|
||||
@@ -103,19 +103,23 @@ typedef struct _intl_data {
|
||||
RETVAL_NEW_STR(u8str); \
|
||||
}
|
||||
|
||||
#define INTL_MAX_LOCALE_LEN 80
|
||||
#define INTL_MAX_LOCALE_LEN (ULOC_FULLNAME_CAPACITY-1)
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len) \
|
||||
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
|
||||
"Locale string too long, should be no longer than 80 characters", 0 ); \
|
||||
char *_msg; \
|
||||
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
|
||||
efree(_msg); \
|
||||
return FAILURE; \
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <unicode/timezone.h>
|
||||
#include <unicode/datefmt.h>
|
||||
#include <unicode/calendar.h>
|
||||
#include <unicode/strenum.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -333,6 +334,24 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
|
||||
return; /* already done */
|
||||
}
|
||||
|
||||
/* There is a bug in ICU which prevents MessageFormatter::getFormats()
|
||||
to handle more than 10 formats correctly. The enumerator could be
|
||||
used to walk through the present formatters using getFormat(), which
|
||||
however seems to provide just a readonly access. This workaround
|
||||
prevents crash when there are > 10 formats but doesn't set any error.
|
||||
As a result, only DateFormatters with > 10 subformats are affected.
|
||||
This workaround should be ifdef'd out, when the bug has been fixed
|
||||
in ICU. */
|
||||
icu::StringEnumeration* fnames = mf->getFormatNames(err.code);
|
||||
if (!fnames || U_FAILURE(err.code)) {
|
||||
return;
|
||||
}
|
||||
count = fnames->count(err.code);
|
||||
delete fnames;
|
||||
if (count > 10) {
|
||||
return;
|
||||
}
|
||||
|
||||
formats = mf->getFormats(count);
|
||||
|
||||
if (formats == NULL) {
|
||||
|
||||
@@ -12,35 +12,29 @@ ini_set("intl.default_locale", "ja");
|
||||
$m = array('createWordInstance', 'createLineInstance', 'createCharacterInstance',
|
||||
'createSentenceInstance', 'createTitleInstance');
|
||||
|
||||
$t = 'Frase 1... Frase 2'.
|
||||
$t = 'Frase 1... Frase 2';
|
||||
|
||||
$o1 = $o2 = null;
|
||||
foreach ($m as $method) {
|
||||
echo "===== $method =====\n";
|
||||
$o1 = call_user_func(array('IntlBreakIterator', $method), 'ja');
|
||||
var_dump($o1 == $o2);
|
||||
$o2 = call_user_func(array('IntlBreakIterator', $method), NULL);
|
||||
var_dump($o1 == $o2);
|
||||
$o1 = IntlBreakIterator::$method('ja');
|
||||
$o2 = IntlBreakIterator::$method(NULL);
|
||||
$o3 = IntlBreakIterator::$method();
|
||||
var_dump($o1 == $o2 && $o2 == $o3);
|
||||
echo "\n";
|
||||
}
|
||||
--EXPECT--
|
||||
===== createWordInstance =====
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
===== createLineInstance =====
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
===== createCharacterInstance =====
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
===== createSentenceInstance =====
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
===== createTitleInstance =====
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
@@ -22,22 +22,22 @@ Warning: IntlBreakIterator::createWordInstance() expects parameter 1 to be strin
|
||||
Warning: IntlBreakIterator::createWordInstance(): breakiter_create_word_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: IntlBreakIterator::createSentenceInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createSentenceInstance() expects at most 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: IntlBreakIterator::createSentenceInstance(): breakiter_create_sentence_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: IntlBreakIterator::createCharacterInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createCharacterInstance() expects at most 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: IntlBreakIterator::createCharacterInstance(): breakiter_create_character_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: IntlBreakIterator::createTitleInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createTitleInstance() expects at most 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: IntlBreakIterator::createTitleInstance(): breakiter_create_title_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: IntlBreakIterator::createLineInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createLineInstance() expects at most 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: IntlBreakIterator::createLineInstance(): breakiter_create_line_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
@@ -3,6 +3,7 @@ Bug #62070: Collator::getSortKey() returns garbage
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') >= 0) die('skip for ICU < 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s1 = 'Hello';
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #62070: Collator::getSortKey() returns garbage
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') < 0) die('skip for ICU >= 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s1 = 'Hello';
|
||||
|
||||
$coll = collator_create('en_US');
|
||||
$res = collator_get_sort_key($coll, $s1);
|
||||
|
||||
echo urlencode($res);
|
||||
--EXPECT--
|
||||
82%40%40F%01%09%01%DC%08
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named placeholder
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$text = "{a} {b} {c} {d} {e} {f} {g} {h} {i} {j} {k} {l}";
|
||||
|
||||
$vars = array(
|
||||
'a' => 1,
|
||||
'b' => 2,
|
||||
'c' => 3,
|
||||
'd' => 4,
|
||||
'e' => 5,
|
||||
'f' => 6,
|
||||
'g' => 7,
|
||||
'h' => 8,
|
||||
'i' => 9,
|
||||
'j' => 10,
|
||||
'k' => 11,
|
||||
'l' => 12
|
||||
);
|
||||
|
||||
var_dump(MessageFormatter::formatMessage('en_US', $text, $vars));
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(26) "1 2 3 4 5 6 7 8 9 10 11 12"
|
||||
==DONE==
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #76556 (get_debug_info handler for BreakIterator shows wrong type)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$it = IntlBreakIterator::createCharacterInstance();
|
||||
$it->setText('foo');
|
||||
var_dump($it);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(IntlRuleBasedBreakIterator)#%d (3) {
|
||||
["valid"]=>
|
||||
bool(true)
|
||||
["text"]=>
|
||||
string(3) "foo"
|
||||
["type"]=>
|
||||
string(%d) "%SRuleBasedBreakIterator%S"
|
||||
}
|
||||
===DONE===
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -79,4 +79,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -23,7 +23,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -80,4 +80,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -22,7 +22,7 @@ function ut_main()
|
||||
'',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
'12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799'
|
||||
);
|
||||
|
||||
foreach( $locales as $locale )
|
||||
@@ -76,4 +76,4 @@ Locale: 'uk@currency=EURO'
|
||||
ULOC_REQUESTED_LOCALE = 'uk@currency=EURO'
|
||||
ULOC_VALID_LOCALE = 'uk'
|
||||
ULOC_ACTUAL_LOCALE = 'uk'
|
||||
Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
Error creating collator with '12345678911131517192123252729313335373941434547495153575961636567697173757779818385878991939597991234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than %d characters: U_ILLEGAL_ARGUMENT_ERROR
|
||||
@@ -3,6 +3,7 @@ collator_get_sort_key() icu >= 56.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '56.1') < 0) die('skip for ICU >= 56.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') >= 0) die('skip for ICU < 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
--TEST--
|
||||
collator_get_sort_key() icu >= 62.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') < 0) die('skip for ICU >= 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get sort keys using various locales
|
||||
*/
|
||||
function sort_arrays( $locale, $data )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach($data as $value) {
|
||||
$res_val = ut_coll_get_sort_key( $coll, $value );
|
||||
$res_str .= "source: ".$value."\n".
|
||||
"key: ".bin2hex($res_val)."\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
// Regular strings keys
|
||||
$test_params = array(
|
||||
'abc', 'abd', 'aaa',
|
||||
'аа', 'а', 'z',
|
||||
'', null , '3',
|
||||
'y' , 'i' , 'k'
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params );
|
||||
|
||||
// Sort a non-ASCII array using ru_RU locale.
|
||||
$test_params = array(
|
||||
'абг', 'абв', 'жжж', 'эюя'
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'ru_RU', $test_params );
|
||||
|
||||
// Sort an array using Lithuanian locale.
|
||||
$res_str .= sort_arrays( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str . "\n";
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
source: abc
|
||||
key: 2a2c2e01070107
|
||||
source: abd
|
||||
key: 2a2c3001070107
|
||||
source: aaa
|
||||
key: 2a2a2a01070107
|
||||
source: аа
|
||||
key: 61060601060106
|
||||
source: а
|
||||
key: 610601050105
|
||||
source: z
|
||||
key: 5c01050105
|
||||
source:
|
||||
key: 0101
|
||||
source:
|
||||
key: 0101
|
||||
source: 3
|
||||
key: 1901050105
|
||||
source: y
|
||||
key: 5a01050105
|
||||
source: i
|
||||
key: 3a01050105
|
||||
source: k
|
||||
key: 3e01050105
|
||||
source: абг
|
||||
key: 27060c1001070107
|
||||
source: абв
|
||||
key: 27060c0e01070107
|
||||
source: жжж
|
||||
key: 272c2c2c01070107
|
||||
source: эюя
|
||||
key: 27eef0f401070107
|
||||
source: абг
|
||||
key: 61060c1001070107
|
||||
source: абв
|
||||
key: 61060c0e01070107
|
||||
source: жжж
|
||||
key: 612c2c2c01070107
|
||||
source: эюя
|
||||
key: 61eef0f401070107
|
||||
@@ -1,7 +1,8 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 56.1
|
||||
numfmt_format() icu >= 56.1 && icu < 61.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '56.1') < 0) die('skip for ICU >= 56.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 61.1 && < 62.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') >= 0) die('skip for ICU < 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Format a number using misc locales/patterns.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
|
||||
* currency and percent formatting.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$styles = array(
|
||||
NumberFormatter::PATTERN_DECIMAL => '##.#####################',
|
||||
NumberFormatter::DECIMAL => '',
|
||||
NumberFormatter::CURRENCY => '',
|
||||
NumberFormatter::PERCENT => '',
|
||||
NumberFormatter::SCIENTIFIC => '',
|
||||
NumberFormatter::SPELLOUT => '@@@@@@@',
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
NumberFormatter::PATTERN_RULEBASED => '#####.###',
|
||||
1234999, // bad one
|
||||
);
|
||||
|
||||
$integer = array(
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
);
|
||||
$locales = array(
|
||||
'en_US',
|
||||
'ru_UA',
|
||||
'de',
|
||||
'fr',
|
||||
'en_UK'
|
||||
);
|
||||
|
||||
$str_res = '';
|
||||
$number = 1234567.891234567890000;
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$str_res .= "\nLocale is: $locale\n";
|
||||
foreach( $styles as $style => $pattern )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, $style, $pattern );
|
||||
|
||||
if(!$fmt) {
|
||||
$str_res .= "Bad formatter!\n";
|
||||
continue;
|
||||
}
|
||||
$str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
|
||||
}
|
||||
}
|
||||
return $str_res;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Locale is: en_US
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'\$1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'USD1,234,567.89'
|
||||
|
||||
Locale is: ru_UA
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ?(грн\.|₴)'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь целых восемьдесят девять миллионов сто двадцать три тысячи четыреста пятьдесят семь стомиллионных'
|
||||
'1 234 567.?'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 UAH'
|
||||
|
||||
Locale is: de
|
||||
'1234567.8912345\d+'
|
||||
'1.234.567,891'
|
||||
'(¤ )?1.234.567,89( ¤)?'
|
||||
'123\.456\.789 %'
|
||||
'1.2345678912345\d+E6'
|
||||
'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf( sechs)? sieben( neun)?'
|
||||
'1.234.567.?'
|
||||
'1.234.567'
|
||||
'#####.###'
|
||||
'1.234.567,89 ¤¤'
|
||||
|
||||
Locale is: fr
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ¤'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?'
|
||||
'1 234 567e'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 ¤¤'
|
||||
|
||||
Locale is: en_UK
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'¤1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'¤¤1,234,567.89'
|
||||
@@ -0,0 +1,130 @@
|
||||
--TEST--
|
||||
numfmt_format() icu >= 62.1
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') < 0) die('skip for ICU >= 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Format a number using misc locales/patterns.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed
|
||||
* currency and percent formatting.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$styles = array(
|
||||
NumberFormatter::PATTERN_DECIMAL => '##.#####################',
|
||||
NumberFormatter::DECIMAL => '',
|
||||
NumberFormatter::CURRENCY => '',
|
||||
NumberFormatter::PERCENT => '',
|
||||
NumberFormatter::SCIENTIFIC => '',
|
||||
NumberFormatter::SPELLOUT => '@@@@@@@',
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
NumberFormatter::PATTERN_RULEBASED => '#####.###',
|
||||
1234999, // bad one
|
||||
);
|
||||
|
||||
$integer = array(
|
||||
NumberFormatter::ORDINAL => '',
|
||||
NumberFormatter::DURATION => '',
|
||||
);
|
||||
$locales = array(
|
||||
'en_US',
|
||||
'ru_UA',
|
||||
'de',
|
||||
'fr',
|
||||
'en_UK'
|
||||
);
|
||||
|
||||
$str_res = '';
|
||||
$number = 1234567.891234567890000;
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$str_res .= "\nLocale is: $locale\n";
|
||||
foreach( $styles as $style => $pattern )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, $style, $pattern );
|
||||
|
||||
if(!$fmt) {
|
||||
$str_res .= "Bad formatter!\n";
|
||||
continue;
|
||||
}
|
||||
$str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n";
|
||||
}
|
||||
}
|
||||
return $str_res;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Locale is: en_US
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'\$1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'USD 1,234,567.89'
|
||||
|
||||
Locale is: ru_UA
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 ?(грн\.|₴)'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь целых восемьдесят девять миллионов сто двадцать три тысячи четыреста пятьдесят семь стомиллионных'
|
||||
'1 234 567.?'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 UAH'
|
||||
|
||||
Locale is: de
|
||||
'1234567.8912345\d+'
|
||||
'1.234.567,891'
|
||||
'1.234.567,89 XXX'
|
||||
'123\.456\.789 %'
|
||||
'1.2345678912345\d+E6'
|
||||
'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf( sechs)? sieben( neun)?'
|
||||
'1.234.567.?'
|
||||
'1.234.567'
|
||||
'#####.###'
|
||||
'1.234.567,89 XXX'
|
||||
|
||||
Locale is: fr
|
||||
'1234567.8912345\d+'
|
||||
'1 234 567,891'
|
||||
'1 234 567,89 XXX'
|
||||
'123 456 789 ?%'
|
||||
'1.2345678912345\d+E6'
|
||||
'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?'
|
||||
'1 234 567e'
|
||||
'1 234 567'
|
||||
'#####.###'
|
||||
'1 234 567,89 XXX'
|
||||
|
||||
Locale is: en_UK
|
||||
'1234567.8912345\d+'
|
||||
'1,234,567.891'
|
||||
'XXX 1,234,567.89'
|
||||
'123,456,789%'
|
||||
'1.2345678912345\d+E6'
|
||||
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'
|
||||
'1,234,567(th|ᵗʰ)'
|
||||
'342:56:07'
|
||||
'#####.###'
|
||||
'XXX 1,234,567.89'
|
||||
@@ -42,9 +42,9 @@ include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
en_UK: '£1,234,567.89'
|
||||
en_US: '$1,234,567.89'
|
||||
ru: '1 234 567,89 р.'
|
||||
uk: '1 234 567,89 ₴'
|
||||
en: 'UAH1,234,567.89'
|
||||
en: 'UAH%A1,234,567.89'
|
||||
@@ -3,6 +3,7 @@ numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') >= 0) die('skip for ICU < 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') < 0) die('skip for ICU >= 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get locale.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$locales = array(
|
||||
'en_UK',
|
||||
'en_US',
|
||||
'fr_CA',
|
||||
);
|
||||
|
||||
$loc_types = array(
|
||||
Locale::ACTUAL_LOCALE => 'actual',
|
||||
Locale::VALID_LOCALE => 'valid',
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
|
||||
$res_str .= "$locale: ";
|
||||
foreach( $loc_types as $loc_type => $loc_type_name )
|
||||
$res_str .= sprintf( " %s=%s",
|
||||
$loc_type_name,
|
||||
dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
|
||||
$res_str .= "\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
en_UK: actual='en' valid='en'
|
||||
en_US: actual='en_US' valid='en_US'
|
||||
fr_CA: actual='fr_CA' valid='fr_CA'
|
||||
@@ -2,6 +2,7 @@
|
||||
numfmt_get/set_pattern()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') >= 0) die('skip for ICU < 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
numfmt_get/set_pattern()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '62.1') < 0) die('skip for ICU >= 62.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get/set pattern.
|
||||
*/
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str = '';
|
||||
$test_value = 12345.123456;
|
||||
$fmt = ut_nfmt_create( "en_US", NumberFormatter::PATTERN_DECIMAL );
|
||||
|
||||
// Get default patten.
|
||||
$res_str .= "Default pattern: '" . ut_nfmt_get_pattern( $fmt ) . "'\n";
|
||||
$res_str .= "Formatting result: " . ut_nfmt_format( $fmt, $test_value ) . "\n";
|
||||
|
||||
// Set a new pattern.
|
||||
$res = ut_nfmt_set_pattern( $fmt, "0.0" );
|
||||
if( $res === false )
|
||||
$res_str .= ut_nfmt_get_error_message( $fmt ) . " (" . ut_nfmt_get_error_code( $fmt ) . ")\n";
|
||||
|
||||
// Check if the pattern has been changed.
|
||||
$res = ut_nfmt_get_pattern( $fmt );
|
||||
if( $res === false )
|
||||
$res_str .= ut_nfmt_get_error_message( $fmt ) . " (" . ut_nfmt_get_error_code( $fmt ) . ")\n";
|
||||
$res_str .= "New pattern: '" . ut_nfmt_get_pattern( $fmt ) . "'\n";
|
||||
$res_str .= "Formatted number: " . ut_nfmt_format( $fmt, $test_value ) . "\n";
|
||||
|
||||
ut_nfmt_set_pattern($fmt, str_repeat('@', 200));
|
||||
$res_str .= "New pattern: '" . ut_nfmt_get_pattern( $fmt ) . "'\n";
|
||||
$res_str .= "Formatted number: " . ut_nfmt_format( $fmt, $test_value ) . "\n";
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Default pattern: '#'
|
||||
Formatting result: 12345.123456
|
||||
New pattern: '0.0'
|
||||
Formatted number: 12345.1
|
||||
New pattern: '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
|
||||
Formatted number: 12345.123456000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
@@ -88,7 +88,7 @@ include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Symbol 'DECIMAL_SEPARATOR_SYMBOL'
|
||||
Default symbol: [.]
|
||||
New symbol: [_._]
|
||||
@@ -132,7 +132,7 @@ A number formatted with the new symbol: 1.2345123456E4
|
||||
Symbol 'CURRENCY_SYMBOL'
|
||||
Default symbol: [$]
|
||||
New symbol: [_$_]
|
||||
A number formatted with the new symbol: _$_12,345.12
|
||||
A number formatted with the new symbol: _$_%A12,345.12
|
||||
|
||||
Symbol 'INTL_CURRENCY_SYMBOL'
|
||||
Default symbol: [USD]
|
||||
|
||||
@@ -24,8 +24,17 @@ $rules = <<<RULES
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump(get_class($rbbi));
|
||||
|
||||
try {
|
||||
$obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
|
||||
} catch (IntlException $e) {
|
||||
var_dump(intl_get_error_code(), intl_get_error_message());
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
==DONE==
|
||||
int(1)
|
||||
string(93) "rbbi_create_instance: unable to create instance from compiled rules: U_ILLEGAL_ARGUMENT_ERROR"
|
||||
==DONE==
|
||||
@@ -2,6 +2,7 @@
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -22,7 +23,7 @@ $rules = <<<RULES
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');;
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
$br = $rbbi->getBinaryRules();
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '61.1') < 0) print 'skip ICU >= 61.1 only'; ?>
|
||||
--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(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -25,7 +25,7 @@ $rules = <<<RULES
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');;
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
do {
|
||||
var_dump($rbbi->current(), $rbbi->getRuleStatusVec());
|
||||
@@ -56,4 +56,4 @@ array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
==DONE==
|
||||
==DONE==
|
||||
Loaded 100 of 381 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user