mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-22 16:35:43 +00:00
Compare commits
229
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9d82b8e26 | ||
|
|
f8fd18ac2f | ||
|
|
73399c1bc1 | ||
|
|
e73cc6b2c2 | ||
|
|
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 | ||
|
|
25f324fad7 | ||
|
|
cab354debd | ||
|
|
0643c7ab4d | ||
|
|
44ba557de5 | ||
|
|
998a2ddc37 | ||
|
|
4ee9098514 | ||
|
|
4cd64aad8a | ||
|
|
eaa5b1f911 | ||
|
|
4dd1be2079 | ||
|
|
f31c4d5398 | ||
|
|
01ea314e8c | ||
|
|
76fc73cbfc | ||
|
|
9c6df8a238 | ||
|
|
8417a23973 | ||
|
|
f1b358c9a9 | ||
|
|
34b9f9dedf | ||
|
|
00bfc6eb49 | ||
|
|
281e2f8207 | ||
|
|
8a57fcdfbd | ||
|
|
50949c9332 | ||
|
|
b711a96acb | ||
|
|
033ce8f28c | ||
|
|
a83581e223 | ||
|
|
60ac255897 | ||
|
|
87553b0730 | ||
|
|
fd5bd37ab1 | ||
|
|
27a603e811 | ||
|
|
350082ed71 | ||
|
|
a827aefe47 | ||
|
|
d5c171311d | ||
|
|
d4387fca0a | ||
|
|
2b033607f3 | ||
|
|
3f32bd9f43 | ||
|
|
b53e547d85 | ||
|
|
c28a6253e5 | ||
|
|
3db7427b71 | ||
|
|
97ff815cbb | ||
|
|
ea4ba9d008 | ||
|
|
c61b56ed00 | ||
|
|
f6356b435a | ||
|
|
9e1113dee1 | ||
|
|
fed294d2a8 | ||
|
|
1e0499b095 | ||
|
|
4698a412bf | ||
|
|
a6f7760d57 | ||
|
|
dde7a05978 | ||
|
|
523f230c83 | ||
|
|
6e300bdeae | ||
|
|
a358211a75 | ||
|
|
ae1f18b69c | ||
|
|
09a19e778b | ||
|
|
1f4b057b63 | ||
|
|
78c1ef2adb | ||
|
|
0b8cfa6c78 | ||
|
|
36239fee36 | ||
|
|
42952a756e | ||
|
|
73cd5fca2c | ||
|
|
74ed42c169 | ||
|
|
e3cf72b829 | ||
|
|
8f3c29aee1 | ||
|
|
656381745a | ||
|
|
276b57316c | ||
|
|
c28b03a8e7 | ||
|
|
ef04bc4a51 | ||
|
|
7b3a2d16aa | ||
|
|
08b4f3c745 | ||
|
|
a468752e53 | ||
|
|
94e9d0a2ae | ||
|
|
372bf8a923 | ||
|
|
da0ed5cdb1 | ||
|
|
da5db1c9b2 | ||
|
|
1f0ea7fa4d | ||
|
|
070211b3e3 | ||
|
|
f706937120 | ||
|
|
fddd7e38bd | ||
|
|
01f7998db0 | ||
|
|
5673c641dc | ||
|
|
8000334538 | ||
|
|
d806d0315f | ||
|
|
01eafceea1 | ||
|
|
495508eceb | ||
|
|
1368aea352 | ||
|
|
42f2ae0572 | ||
|
|
a694433bff | ||
|
|
b1ee215c69 | ||
|
|
2ae46f8eb6 | ||
|
|
bced074124 | ||
|
|
fe2ac52d50 | ||
|
|
fb128f6512 | ||
|
|
a882f95e39 | ||
|
|
4bd7658e1b | ||
|
|
aad76a9b79 | ||
|
|
f80e59a566 | ||
|
|
3ffdf6c088 | ||
|
|
e954bafc28 | ||
|
|
e88e83d3e5 | ||
|
|
d46d53a7bc | ||
|
|
594a4da3e5 | ||
|
|
2384ade53c | ||
|
|
fb205020ce | ||
|
|
043d53c789 | ||
|
|
ea56fc840e |
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.13
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.5
|
||||
# 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
|
||||
|
||||
@@ -171,7 +173,7 @@ define ____printzv_contents
|
||||
printf "UNDEF"
|
||||
end
|
||||
if $type == 1
|
||||
printf "NULL"
|
||||
printf "NULL"
|
||||
end
|
||||
if $type == 2
|
||||
printf "bool: false"
|
||||
@@ -179,15 +181,15 @@ define ____printzv_contents
|
||||
if $type == 3
|
||||
printf "bool: true"
|
||||
end
|
||||
if $type == 4
|
||||
if $type == 4
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
end
|
||||
if $type == 5
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
end
|
||||
if $type == 6
|
||||
printf "string: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 7
|
||||
printf "array: "
|
||||
if ! $arg1
|
||||
@@ -245,25 +247,31 @@ define ____printzv_contents
|
||||
printf "const: %s", $zvalue->value.str->val
|
||||
end
|
||||
if $type == 12
|
||||
printf "const_ast"
|
||||
printf "CONSTANT_AST"
|
||||
end
|
||||
if $type == 13
|
||||
printf "_IS_BOOL"
|
||||
printf "_BOOL"
|
||||
end
|
||||
if $type == 14
|
||||
printf "IS_CALLABLE"
|
||||
printf "CALLABLE"
|
||||
end
|
||||
if $type == 15
|
||||
printf "indirect: "
|
||||
____printzv $zvalue->value.zv $arg1
|
||||
end
|
||||
if $type == 16
|
||||
printf "string_offset"
|
||||
end
|
||||
if $type == 17
|
||||
printf "pointer: %p", $zvalue->value.ptr
|
||||
end
|
||||
if $type > 17
|
||||
if $type == 18
|
||||
printf "ITERABLE"
|
||||
end
|
||||
if $type == 19
|
||||
printf "VOID"
|
||||
end
|
||||
if $type == 20
|
||||
printf "_ERROR"
|
||||
end
|
||||
if $type == 16 || $type > 20
|
||||
printf "unknown type %d", $type
|
||||
end
|
||||
printf "\n"
|
||||
@@ -283,38 +291,28 @@ define ____printzv
|
||||
end
|
||||
end
|
||||
|
||||
define ____print_const_table
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
define print_global_vars
|
||||
____executor_globals
|
||||
set $symtable = ((HashTable *)&($eg_ptr->symbol_table))
|
||||
print_ht $symtable
|
||||
end
|
||||
|
||||
while $p != 0
|
||||
set $const = (zend_constant *) $p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
____print_str $p->arKey $p->nKeyLength
|
||||
printf " => "
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
____printzv_contents &$const->value 0
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
document print_global_vars
|
||||
Prints the global variables
|
||||
end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
____print_const_table $arg0
|
||||
____print_ht $arg0 4
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_const_table
|
||||
Dumps elements of Constants HashTable
|
||||
Example: print_const_table executor_globals.zend_constants
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = (HashTable*)$arg0
|
||||
set $n = $ind
|
||||
@@ -361,6 +359,10 @@ define ____print_ht
|
||||
set $func = (zend_function*)$p->val.value.ptr
|
||||
printf "\"%s\"\n", $func->common.function_name->val
|
||||
end
|
||||
if $arg1 == 4
|
||||
set $const = (zend_constant *)$p->val.value.ptr
|
||||
____printzv $const 1
|
||||
end
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
@@ -472,9 +474,12 @@ end
|
||||
|
||||
define print_pi
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
set $initial_offset = ((uint32_t)(zend_uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
|
||||
set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
|
||||
printf "[%p] {\n", $pi
|
||||
printf " offset = %p\n", $pi->offset
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = %d (", $pi->flags
|
||||
printf " flags = 0x%x (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
else
|
||||
@@ -485,7 +490,11 @@ define print_pi
|
||||
printf "ZEND_ACC_PRIVATE"
|
||||
else
|
||||
if $pi->flags & 0x800
|
||||
printf "ZEND_ACC_CHANGED"
|
||||
printf "ZEND_ACC_EARLY_BINDING"
|
||||
else
|
||||
if $pi->flags & 0x20000
|
||||
printf "ZEND_ACC_SHADOW"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -493,6 +502,8 @@ define print_pi
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
print_zstr $pi->name
|
||||
printf " default value: "
|
||||
printzv $ptr_to_val
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
|
||||
@@ -1,6 +1,174 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2018, PHP 7.1.14
|
||||
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).
|
||||
(Dmitry, Laruence)
|
||||
. 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)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #76088 (ODBC functions are not available by default on Windows).
|
||||
(cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76074 (opcache corrupts variable in for-loop). (Bob)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #76085 (Segmentation fault in buildFromIterator when directory
|
||||
name contains a \n). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74139 (mail.add_x_header default inconsistent with docs). (cmb)
|
||||
. Fixed bug #76068 (parse_ini_string fails to parse "[foo]\nbar=1|>baz" with
|
||||
segfault). (Anatol)
|
||||
|
||||
01 Mar 2018, PHP 7.1.15
|
||||
|
||||
- Apache2Handler:
|
||||
. Fixed bug #75882 (a simple way for segfaults in threadsafe php just with
|
||||
configuration). (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75857 (Timezone gets truncated when formatted). (carusogabriel)
|
||||
. Fixed bug #75928 (Argument 2 for `DateTimeZone::listIdentifiers()` should
|
||||
accept `null`). (Pedro Lacerda)
|
||||
. Fixed bug #68406 (calling var_dump on a DateTimeZone object modifies it).
|
||||
(jhdxr)
|
||||
|
||||
- FTP:
|
||||
. Fixed ftp_pasv arginfo. (carusogabriel)
|
||||
|
||||
-GD:
|
||||
. Fixed imagesetinterpolation arginfo. (Gabriel Caruso)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #75867 (Freeing uninitialized pointer). (Philip Prindeville)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug #49876 (Fix LDAP path lookup on 64-bit distros). (dzuelke)
|
||||
|
||||
- libxml2:
|
||||
. Fixed bug #75871 (use pkg-config where available). (pmmaga)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed negotiation of MySQL authenticaton plugin. (Johannes)
|
||||
. Fixed a memleak with SSL connections. (Johannes)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #73725 (Unable to retrieve value of varchar(max) type). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75969 (Assertion failure in live range DCE due to block pass
|
||||
misoptimization). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed openssl_* arginfos. (carusogabriel)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug #75873 (pcntl_wexitstatus returns incorrect on Big_Endian platform
|
||||
(s390x)). (Sam Ding)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed #75838 (Memory leak in pg_escape_bytea()). (ard_1 at mail dot ru)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65414 (deal with leading slash when adding files correctly).
|
||||
(bishopb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74519 (strange behavior of AppendIterator). (jhdxr)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75961 (Strange references behavior). (Laruence)
|
||||
. Fixed bug #75916 (DNS_CAA record results contain garbage). (Mike,
|
||||
Philip Sharp)
|
||||
. Fixed some arginfos. (carusogabriel)
|
||||
. Fixed bug #75981 (stack-buffer-overflow while parsing HTTP response). (Stas)
|
||||
|
||||
01 Feb 2018, PHP 7.1.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75679 (Path 260 character problem). (Anatol)
|
||||
@@ -19,6 +187,9 @@ PHP NEWS
|
||||
- IMAP:
|
||||
. Fixed bug #75774 (imap_append HeapCorruction). (Anatol)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #62545 (wrong unicode mapping in some charsets). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #75720 (File cache not populated after SHM runs full). (Dmitry)
|
||||
. Fixed bug #75579 (Interned strings buffer overflow may cause crash).
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #76025 (Segfault while throwing exception in error_handler)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function handleError($errno, $errstr, $errfile, $errline) {
|
||||
$exception = new exception("blah");
|
||||
throw $exception;
|
||||
}
|
||||
set_error_handler('handleError', E_ALL);
|
||||
$c = $b[$a];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: blah in %sbug76025.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug76025.php on line %d
|
||||
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -720,7 +720,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
|
||||
int _num_args = EX_NUM_ARGS(); \
|
||||
int _i; \
|
||||
zval *_real_arg, *_arg = NULL; \
|
||||
zend_expected_type _expected_type = IS_UNDEF; \
|
||||
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
|
||||
char *_error = NULL; \
|
||||
zend_bool _dummy; \
|
||||
zend_bool _optional = 0; \
|
||||
|
||||
+4
-3
@@ -213,9 +213,10 @@ static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend
|
||||
|
||||
static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var, const zend_execute_data *execute_data)
|
||||
{
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
|
||||
zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
|
||||
}
|
||||
}
|
||||
|
||||
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data)
|
||||
|
||||
+1
-1
@@ -1765,7 +1765,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
|
||||
GC_TYPE_INFO(target) = IS_ARRAY;
|
||||
|
||||
target->nTableSize = source->nTableSize;
|
||||
target->pDestructor = source->pDestructor;
|
||||
target->pDestructor = ZVAL_PTR_DTOR;
|
||||
|
||||
if (source->nNumUsed == 0) {
|
||||
target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
|
||||
|
||||
+12
-4
@@ -57,11 +57,19 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
if (IS_LONG == Z_TYPE_P(op1)) {
|
||||
i_op1 = Z_LVAL_P(op1);
|
||||
} else {
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
}
|
||||
if (op2) {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
if (IS_LONG == Z_TYPE_P(op2)) {
|
||||
i_op2 = Z_LVAL_P(op2);
|
||||
} else {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
}
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
+56
-28
@@ -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
|
||||
])
|
||||
|
||||
@@ -2534,15 +2537,18 @@ dnl
|
||||
dnl Common setup macro for libxml
|
||||
dnl
|
||||
AC_DEFUN([PHP_SETUP_LIBXML], [
|
||||
AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
[
|
||||
for i in $PHP_LIBXML_DIR /usr/local /usr; do
|
||||
if test -x "$i/bin/xml2-config"; then
|
||||
ac_cv_php_xml2_config_path="$i/bin/xml2-config"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
found_libxml=no
|
||||
|
||||
dnl First try to find xml2-config
|
||||
AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
[
|
||||
for i in $PHP_LIBXML_DIR /usr/local /usr; do
|
||||
if test -x "$i/bin/xml2-config"; then
|
||||
ac_cv_php_xml2_config_path="$i/bin/xml2-config"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
if test -x "$ac_cv_php_xml2_config_path"; then
|
||||
XML2_CONFIG="$ac_cv_php_xml2_config_path"
|
||||
@@ -2553,30 +2559,52 @@ AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
|
||||
IFS=$ac_IFS
|
||||
LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
|
||||
if test "$LIBXML_VERSION" -ge "2006011"; then
|
||||
found_libxml=yes
|
||||
LIBXML_LIBS=`$XML2_CONFIG --libs`
|
||||
LIBXML_INCS=`$XML2_CONFIG --cflags`
|
||||
PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($LIBXML_INCS)
|
||||
|
||||
dnl Check that build works with given libs
|
||||
AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
|
||||
PHP_TEST_BUILD(xmlInitParser,
|
||||
[
|
||||
php_cv_libxml_build_works=yes
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
], [
|
||||
[$]$1
|
||||
])
|
||||
])
|
||||
if test "$php_cv_libxml_build_works" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
fi
|
||||
$2
|
||||
else
|
||||
AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If xml2-config fails, try pkg-config
|
||||
if test "$found_libxml" = "no"; then
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libxml-2.0; then
|
||||
if $PKG_CONFIG --atleast-version=2.6.11 libxml-2.0; then
|
||||
found_libxml=yes
|
||||
LIBXML_LIBS=`$PKG_CONFIG --libs libxml-2.0`
|
||||
LIBXML_INCS=`$PKG_CONFIG --cflags-only-I libxml-2.0`
|
||||
else
|
||||
AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$found_libxml" = "yes"; then
|
||||
PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($LIBXML_INCS)
|
||||
|
||||
dnl Check that build works with given libs
|
||||
AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
|
||||
PHP_TEST_BUILD(xmlInitParser,
|
||||
[
|
||||
php_cv_libxml_build_works=yes
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
], [
|
||||
[$]$1
|
||||
])
|
||||
])
|
||||
if test "$php_cv_libxml_build_works" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
fi
|
||||
$2
|
||||
ifelse([$3],[],,[else $3])
|
||||
fi
|
||||
])
|
||||
|
||||
+6
-3
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=19
|
||||
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`
|
||||
|
||||
@@ -1286,7 +1286,10 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
|
||||
|
||||
# SOURCE_DATE_EPOCH for reproducible builds https://reproducible-builds.org/specs/source-date-epoch/
|
||||
PHP_BUILD_DATE=`date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
|
||||
if test $? -ne 0 ; then
|
||||
PHP_BUILD_DATE=`date -u +%Y-%m-%d`
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
|
||||
|
||||
case $host_alias in
|
||||
|
||||
@@ -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--
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
+1577
-1564
File diff suppressed because it is too large.
Load diff
+107
-66
@@ -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)
|
||||
@@ -655,6 +655,7 @@ static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n);
|
||||
static HashTable *date_object_get_properties_period(zval *object);
|
||||
static HashTable *date_object_get_properties_timezone(zval *object);
|
||||
static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n);
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp);
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
|
||||
@@ -1128,38 +1129,38 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
rfc_colon = 0;
|
||||
switch (format[i]) {
|
||||
/* day */
|
||||
case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, 32, "%s", php_date_short_day_name(t->y, t->m, t->d)); break;
|
||||
case 'j': length = slprintf(buffer, 32, "%d", (int) t->d); break;
|
||||
case 'l': length = slprintf(buffer, 32, "%s", php_date_full_day_name(t->y, t->m, t->d)); break;
|
||||
case 'S': length = slprintf(buffer, 32, "%s", english_suffix(t->d)); break;
|
||||
case 'w': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'N': length = slprintf(buffer, 32, "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'z': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
|
||||
case 'd': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, sizeof(buffer), "%s", php_date_short_day_name(t->y, t->m, t->d)); break;
|
||||
case 'j': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->d); break;
|
||||
case 'l': length = slprintf(buffer, sizeof(buffer), "%s", php_date_full_day_name(t->y, t->m, t->d)); break;
|
||||
case 'S': length = slprintf(buffer, sizeof(buffer), "%s", english_suffix(t->d)); break;
|
||||
case 'w': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'N': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break;
|
||||
case 'z': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
|
||||
|
||||
/* week */
|
||||
case 'W':
|
||||
if(!weekYearSet) { timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); weekYearSet = 1; }
|
||||
length = slprintf(buffer, 32, "%02d", (int) isoweek); break; /* iso weeknr */
|
||||
length = slprintf(buffer, sizeof(buffer), "%02d", (int) isoweek); break; /* iso weeknr */
|
||||
case 'o':
|
||||
if(!weekYearSet) { timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); weekYearSet = 1; }
|
||||
length = slprintf(buffer, 32, "%d", (int) isoyear); break; /* iso year */
|
||||
length = slprintf(buffer, sizeof(buffer), "%d", (int) isoyear); break; /* iso year */
|
||||
|
||||
/* month */
|
||||
case 'F': length = slprintf(buffer, 32, "%s", mon_full_names[t->m - 1]); break;
|
||||
case 'm': length = slprintf(buffer, 32, "%02d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, 32, "%s", mon_short_names[t->m - 1]); break;
|
||||
case 'n': length = slprintf(buffer, 32, "%d", (int) t->m); break;
|
||||
case 't': length = slprintf(buffer, 32, "%d", (int) timelib_days_in_month(t->y, t->m)); break;
|
||||
case 'F': length = slprintf(buffer, sizeof(buffer), "%s", mon_full_names[t->m - 1]); break;
|
||||
case 'm': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, sizeof(buffer), "%s", mon_short_names[t->m - 1]); break;
|
||||
case 'n': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->m); break;
|
||||
case 't': length = slprintf(buffer, sizeof(buffer), "%d", (int) timelib_days_in_month(t->y, t->m)); break;
|
||||
|
||||
/* year */
|
||||
case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break;
|
||||
case 'y': length = slprintf(buffer, 32, "%02d", (int) t->y % 100); break;
|
||||
case 'Y': length = slprintf(buffer, 32, "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break;
|
||||
case 'L': length = slprintf(buffer, sizeof(buffer), "%d", timelib_is_leap((int) t->y)); break;
|
||||
case 'y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->y % 100); break;
|
||||
case 'Y': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break;
|
||||
|
||||
/* time */
|
||||
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'a': length = slprintf(buffer, sizeof(buffer), "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
case 'A': length = slprintf(buffer, sizeof(buffer), "%s", t->h >= 12 ? "PM" : "AM"); break;
|
||||
case 'B': {
|
||||
int retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
|
||||
if (retval < 0) {
|
||||
@@ -1167,41 +1168,41 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
}
|
||||
/* Make sure to do this on a positive int to avoid rounding errors */
|
||||
retval = (retval / 864) % 1000;
|
||||
length = slprintf(buffer, 32, "%03d", retval);
|
||||
length = slprintf(buffer, sizeof(buffer), "%03d", retval);
|
||||
break;
|
||||
}
|
||||
case 'g': length = slprintf(buffer, 32, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'G': length = slprintf(buffer, 32, "%d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, 32, "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break;
|
||||
case 'i': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
|
||||
case 's': length = slprintf(buffer, 32, "%02d", (int) t->s); break;
|
||||
case 'u': length = slprintf(buffer, 32, "%06d", (int) floor(t->f * 1000000 + 0.5)); break;
|
||||
case 'v': length = slprintf(buffer, 32, "%03d", (int) floor(t->f * 1000 + 0.5)); break;
|
||||
case 'g': length = slprintf(buffer, sizeof(buffer), "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'G': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, sizeof(buffer), "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break;
|
||||
case 'H': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->h); break;
|
||||
case 'i': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->i); break;
|
||||
case 's': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->s); break;
|
||||
case 'u': length = slprintf(buffer, sizeof(buffer), "%06d", (int) floor(t->f * 1000000 + 0.5)); break;
|
||||
case 'v': length = slprintf(buffer, sizeof(buffer), "%03d", (int) floor(t->f * 1000 + 0.5)); break;
|
||||
|
||||
/* timezone */
|
||||
case 'I': length = slprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break;
|
||||
case 'I': length = slprintf(buffer, sizeof(buffer), "%d", localtime ? offset->is_dst : 0); break;
|
||||
case 'P': rfc_colon = 1; /* break intentionally missing */
|
||||
case 'O': length = slprintf(buffer, 32, "%c%02d%s%02d",
|
||||
case 'O': length = slprintf(buffer, sizeof(buffer), "%c%02d%s%02d",
|
||||
localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
localtime ? abs(offset->offset / 3600) : 0,
|
||||
rfc_colon ? ":" : "",
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'T': length = slprintf(buffer, 32, "%s", localtime ? offset->abbr : "GMT"); break;
|
||||
case 'T': length = slprintf(buffer, sizeof(buffer), "%s", localtime ? offset->abbr : "GMT"); break;
|
||||
case 'e': if (!localtime) {
|
||||
length = slprintf(buffer, 32, "%s", "UTC");
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", "UTC");
|
||||
} else {
|
||||
switch (t->zone_type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
length = slprintf(buffer, 32, "%s", t->tz_info->name);
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", t->tz_info->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
length = slprintf(buffer, 32, "%s", offset->abbr);
|
||||
length = slprintf(buffer, sizeof(buffer), "%s", offset->abbr);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET:
|
||||
length = slprintf(buffer, 32, "%c%02d:%02d",
|
||||
length = slprintf(buffer, sizeof(buffer), "%c%02d:%02d",
|
||||
((offset->offset < 0) ? '-' : '+'),
|
||||
abs(offset->offset / 3600),
|
||||
abs((offset->offset % 3600) / 60)
|
||||
@@ -1210,10 +1211,10 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'Z': length = slprintf(buffer, 32, "%d", localtime ? offset->offset : 0); break;
|
||||
case 'Z': length = slprintf(buffer, sizeof(buffer), "%d", localtime ? offset->offset : 0); break;
|
||||
|
||||
/* full date/time */
|
||||
case 'c': length = slprintf(buffer, 96, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||
case 'c': length = slprintf(buffer, sizeof(buffer), "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||
(int) t->y, (int) t->m, (int) t->d,
|
||||
(int) t->h, (int) t->i, (int) t->s,
|
||||
localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
|
||||
@@ -1221,7 +1222,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'r': length = slprintf(buffer, 96, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
|
||||
case 'r': length = slprintf(buffer, sizeof(buffer), "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
|
||||
php_date_short_day_name(t->y, t->m, t->d),
|
||||
(int) t->d, mon_short_names[t->m - 1],
|
||||
(int) t->y, (int) t->h, (int) t->i, (int) t->s,
|
||||
@@ -1230,7 +1231,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
|
||||
localtime ? abs((offset->offset % 3600) / 60) : 0
|
||||
);
|
||||
break;
|
||||
case 'U': length = slprintf(buffer, 32, "%lld", (timelib_sll) t->sse); break;
|
||||
case 'U': length = slprintf(buffer, sizeof(buffer), "%lld", (timelib_sll) t->sse); break;
|
||||
|
||||
case '\\': if (i < format_len) i++; /* break intentionally missing */
|
||||
|
||||
@@ -2020,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;
|
||||
@@ -2040,7 +2041,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2100,6 +2101,7 @@ static void date_register_classes(void) /* {{{ */
|
||||
date_object_handlers_timezone.clone_obj = date_object_clone_timezone;
|
||||
date_object_handlers_timezone.get_properties = date_object_get_properties_timezone;
|
||||
date_object_handlers_timezone.get_gc = date_object_get_gc_timezone;
|
||||
date_object_handlers_timezone.get_debug_info = date_object_get_debug_info_timezone;
|
||||
|
||||
#define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \
|
||||
zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value);
|
||||
@@ -2377,6 +2379,45 @@ static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
|
||||
return props;
|
||||
} /* }}} */
|
||||
|
||||
static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp) /* {{{ */
|
||||
{
|
||||
HashTable *ht, *props;
|
||||
zval zv;
|
||||
php_timezone_obj *tzobj;
|
||||
|
||||
tzobj = Z_PHPTIMEZONE_P(object);
|
||||
props = zend_std_get_properties(object);
|
||||
|
||||
*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);
|
||||
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
ZVAL_STRING(&zv, tzobj->tzi.tz->name);
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_OFFSET: {
|
||||
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
|
||||
|
||||
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
|
||||
tzobj->tzi.utc_offset > 0 ? '-' : '+',
|
||||
abs(tzobj->tzi.utc_offset / 60),
|
||||
abs((tzobj->tzi.utc_offset % 60)));
|
||||
|
||||
ZVAL_NEW_STR(&zv, tmpstr);
|
||||
}
|
||||
break;
|
||||
case TIMELIB_ZONETYPE_ABBR:
|
||||
ZVAL_STRING(&zv, tzobj->tzi.z.abbr);
|
||||
break;
|
||||
}
|
||||
zend_hash_str_update(ht, "timezone", sizeof("timezone")-1, &zv);
|
||||
|
||||
return ht;
|
||||
} /* }}} */
|
||||
|
||||
static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props) /* {{{ */
|
||||
{
|
||||
php_interval_obj *intern;
|
||||
@@ -4411,38 +4452,38 @@ static zend_string *date_interval_format(char *format, size_t format_len, timeli
|
||||
for (i = 0; i < format_len; i++) {
|
||||
if (have_format_spec) {
|
||||
switch (format[i]) {
|
||||
case 'Y': length = slprintf(buffer, 32, "%02d", (int) t->y); break;
|
||||
case 'y': length = slprintf(buffer, 32, "%d", (int) t->y); break;
|
||||
case 'Y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->y); break;
|
||||
case 'y': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->y); break;
|
||||
|
||||
case 'M': length = slprintf(buffer, 32, "%02d", (int) t->m); break;
|
||||
case 'm': length = slprintf(buffer, 32, "%d", (int) t->m); break;
|
||||
case 'M': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->m); break;
|
||||
case 'm': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->m); break;
|
||||
|
||||
case 'D': length = slprintf(buffer, 32, "%02d", (int) t->d); break;
|
||||
case 'd': length = slprintf(buffer, 32, "%d", (int) t->d); break;
|
||||
case 'D': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->d); break;
|
||||
case 'd': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->d); break;
|
||||
|
||||
case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, 32, "%d", (int) t->h); break;
|
||||
case 'H': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->h); break;
|
||||
case 'h': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->h); break;
|
||||
|
||||
case 'I': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
|
||||
case 'i': length = slprintf(buffer, 32, "%d", (int) t->i); break;
|
||||
case 'I': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->i); break;
|
||||
case 'i': length = slprintf(buffer, sizeof(buffer), "%d", (int) t->i); break;
|
||||
|
||||
case 'S': length = slprintf(buffer, 32, "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
|
||||
case 's': length = slprintf(buffer, 32, ZEND_LONG_FMT, (zend_long) t->s); break;
|
||||
case 'S': length = slprintf(buffer, sizeof(buffer), "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
|
||||
case 's': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->s); break;
|
||||
|
||||
case 'F': length = slprintf(buffer, 32, "%06" ZEND_LONG_FMT_SPEC, (zend_long) (t->f * 1000000)); break;
|
||||
case 'f': length = slprintf(buffer, 32, ZEND_LONG_FMT, (zend_long) (t->f * 1000000)); break;
|
||||
case 'F': length = slprintf(buffer, sizeof(buffer), "%06" ZEND_LONG_FMT_SPEC, (zend_long) (t->f * 1000000)); break;
|
||||
case 'f': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) (t->f * 1000000)); break;
|
||||
|
||||
case 'a': {
|
||||
if ((int) t->days != -99999) {
|
||||
length = slprintf(buffer, 32, "%d", (int) t->days);
|
||||
length = slprintf(buffer, sizeof(buffer), "%d", (int) t->days);
|
||||
} else {
|
||||
length = slprintf(buffer, 32, "(unknown)");
|
||||
length = slprintf(buffer, sizeof(buffer), "(unknown)");
|
||||
}
|
||||
} break;
|
||||
case 'r': length = slprintf(buffer, 32, "%s", t->invert ? "-" : ""); break;
|
||||
case 'R': length = slprintf(buffer, 32, "%c", t->invert ? '-' : '+'); break;
|
||||
case 'r': length = slprintf(buffer, sizeof(buffer), "%s", t->invert ? "-" : ""); break;
|
||||
case 'R': length = slprintf(buffer, sizeof(buffer), "%c", t->invert ? '-' : '+'); break;
|
||||
|
||||
case '%': length = slprintf(buffer, 32, "%%"); break;
|
||||
case '%': length = slprintf(buffer, sizeof(buffer), "%%"); break;
|
||||
default: buffer[0] = '%'; buffer[1] = format[i]; buffer[2] = '\0'; length = 2; break;
|
||||
}
|
||||
smart_str_appendl(&string, buffer, length);
|
||||
@@ -4701,11 +4742,11 @@ PHP_FUNCTION(timezone_identifiers_list)
|
||||
const timelib_tzdb *tzdb;
|
||||
const timelib_tzdb_index_entry *table;
|
||||
int i, item_count;
|
||||
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
|
||||
zend_long what = PHP_DATE_TIMEZONE_GROUP_ALL;
|
||||
char *option = NULL;
|
||||
size_t option_len = 0;
|
||||
size_t option_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls", &what, &option, &option_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls!", &what, &option, &option_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,34 +39,30 @@ object(DateTimeZone)#%d (2) {
|
||||
|
||||
-- Add some properties --
|
||||
object(DateTimeZone)#%d (4) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
string(5) "Hello"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- clone it --
|
||||
object(DateTimeZone)#%d (4) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
string(5) "Hello"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- Add some more properties --
|
||||
object(DateTimeZone)#%d (6) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
@@ -75,14 +71,14 @@ object(DateTimeZone)#%d (6) {
|
||||
bool(true)
|
||||
["property4"]=>
|
||||
float(10.5)
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
|
||||
-- clone it --
|
||||
object(DateTimeZone)#%d (6) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
["property1"]=>
|
||||
int(99)
|
||||
["property2"]=>
|
||||
@@ -91,5 +87,9 @@ object(DateTimeZone)#%d (6) {
|
||||
bool(true)
|
||||
["property4"]=>
|
||||
float(10.5)
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/London"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #68406 calling var_dump on a DateTimeZone object modifies it
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tz1 = new DateTimeZone('Europe/Berlin');
|
||||
$tz2 = new DateTimeZone('Europe/Berlin');
|
||||
|
||||
$d = new DateTime('2014-12-24 13:00:00', $tz1);
|
||||
var_dump($d->getTimezone(), $tz2);
|
||||
|
||||
if($tz2 == $d->getTimezone()) {
|
||||
echo "yes";
|
||||
}
|
||||
else {
|
||||
echo "no";
|
||||
}
|
||||
|
||||
--EXPECT--
|
||||
object(DateTimeZone)#4 (2) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/Berlin"
|
||||
}
|
||||
object(DateTimeZone)#2 (2) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/Berlin"
|
||||
}
|
||||
yes
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Failing test case for #75857: Long timezones truncation
|
||||
--CREDITS--
|
||||
Gabriel Caruso (carusogabriel34@gmail.com)
|
||||
--FILE--
|
||||
<?php
|
||||
$longDate = new DateTime('now', new DateTimeZone('America/Argentina/ComodRivadavia'));
|
||||
$mediumDate = new DateTime('now', new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
$smallDate = new DateTime('now', new DateTimeZone('America/Sao_Paulo'));
|
||||
|
||||
var_dump($longDate->format('e'));
|
||||
var_dump($mediumDate->format('e'));
|
||||
var_dump($smallDate->format('e'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(32) "America/Argentina/ComodRivadavia"
|
||||
string(28) "America/Indiana/Indianapolis"
|
||||
string(17) "America/Sao_Paulo"
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #75928: Argument 2 for `DateTimeZone::listIdentifiers()` should accept `null`
|
||||
--FILE--
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
var_dump(is_array(DateTimeZone::listIdentifiers(\DateTimeZone::ALL, null)));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+1
-1
@@ -33,6 +33,6 @@ if test "$PHP_DOM" != "no"; then
|
||||
PHP_INSTALL_HEADERS([ext/dom/xml_common.h])
|
||||
PHP_ADD_EXTENSION_DEP(dom, libxml)
|
||||
], [
|
||||
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
|
||||
AC_MSG_ERROR([libxml2 not found. Please check your libxml2 installation.])
|
||||
])
|
||||
fi
|
||||
@@ -598,7 +598,6 @@ PHP_MINIT_FUNCTION(dom)
|
||||
memcpy(&dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
dom_object_handlers.offset = XtOffsetOf(dom_object, std);
|
||||
dom_object_handlers.free_obj = dom_objects_free_storage;
|
||||
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
|
||||
dom_object_handlers.read_property = dom_read_property;
|
||||
dom_object_handlers.write_property = dom_write_property;
|
||||
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
|
||||
|
||||
@@ -719,7 +719,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
}
|
||||
|
||||
if (sugg) {
|
||||
zval_dtor(sugg);
|
||||
zval_ptr_dtor(sugg);
|
||||
array_init(sugg);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 */
|
||||
|
||||
@@ -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.
+1
-1
@@ -141,7 +141,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, resumepos)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_ftp_pasv, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_pasv, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, ftp)
|
||||
ZEND_ARG_INFO(0, pasv)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
+2
-2
@@ -819,7 +819,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_imageaffinematrixconcat, 0)
|
||||
ZEND_ARG_INFO(0, m2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_imagesetinterpolation, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagesetinterpolation, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, im)
|
||||
ZEND_ARG_INFO(0, method)
|
||||
ZEND_END_ARG_INFO()
|
||||
@@ -4720,7 +4720,7 @@ PHP_FUNCTION(imagescale)
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_h <= 0 || tmp_w <= 0) {
|
||||
if (tmp_h <= 0 || tmp_h > INT_MAX || tmp_w <= 0 || tmp_w > INT_MAX) {
|
||||
RETURN_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 |
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #73957 (signed integer conversion in imagescale())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(8, 8);
|
||||
$im = imagescale($im, 0x100000001, 1);
|
||||
var_dump($im);
|
||||
if ($im) { // which is not supposed to happen
|
||||
var_dump(imagesx($im));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
===DONE===
|
||||
+2
-2
@@ -1956,8 +1956,8 @@ ZEND_FUNCTION(gmp_setbit)
|
||||
php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX ) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %ld * %ld", INT_MAX, GMP_NUMB_BITS);
|
||||
if (index / GMP_NUMB_BITS >= INT_MAX) {
|
||||
php_error_docref(NULL, E_WARNING, "Index must be less than %d * %d", INT_MAX, GMP_NUMB_BITS);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -563,6 +563,8 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
size_t result;
|
||||
zend_string *ret, *out_buffer;
|
||||
|
||||
*out = NULL;
|
||||
|
||||
/*
|
||||
This is not the right way to get output size...
|
||||
This is not space efficient for large text.
|
||||
@@ -2656,6 +2658,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,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) {
|
||||
|
||||
@@ -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; \
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
*/
|
||||
PHP_METHOD(Spoofchecker, __construct)
|
||||
{
|
||||
#if U_ICU_VERSION_MAJOR_NUM < 58
|
||||
int checks;
|
||||
#endif
|
||||
zend_error_handling error_handling;
|
||||
SPOOFCHECKER_METHOD_INIT_VARS;
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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,130 @@
|
||||
--TEST--
|
||||
numfmt_format() 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'); ?>
|
||||
--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'
|
||||
@@ -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==
|
||||
@@ -1,9 +1,8 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') >= 0) die('skip for ICU < 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -29,4 +28,4 @@ var_dump($rbbi->getRules());
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(128) "$LN = [[:letter:] [:number:]];$S = [.;,:];!!forward;$LN+ {1};$S+ {42};!!reverse;$LN+ {1};$S+ {42};!!safe_forward;!!safe_reverse;"
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '61.1') < 0) die('skip for ICU >= 61.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rules = <<<RULES
|
||||
\$LN = [[:letter:] [:number:]];
|
||||
\$S = [.;,:];
|
||||
|
||||
!!forward;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!reverse;
|
||||
\$LN+ {1};
|
||||
\$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump($rbbi->getRules());
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(137) "$LN = [[:letter:] [:number:]];
|
||||
$S = [.;,:];
|
||||
!!forward;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!reverse;
|
||||
$LN+ {1};
|
||||
$S+ {42};
|
||||
!!safe_forward;
|
||||
!!safe_reverse;"
|
||||
==DONE==
|
||||
+12
-10
@@ -117,14 +117,16 @@ if test "$PHP_LDAP" != "no"; then
|
||||
LDAP_PTHREAD=
|
||||
fi
|
||||
|
||||
if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
|
||||
MACHINE_INCLUDES=$($CC -dumpmachine)
|
||||
|
||||
if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
|
||||
elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libssldap50.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
@@ -137,7 +139,7 @@ if test "$PHP_LDAP" != "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldapssl41.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
@@ -147,35 +149,35 @@ if test "$PHP_LDAP" != "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldapssl41, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldapssl30.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libldap30.$SHLIB_SUFFIX_NAME; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libumich_ldap.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_12,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1 || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_11,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/libclntsh.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
|
||||
|
||||
+5
-1
@@ -1170,7 +1170,11 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
|
||||
add_assoc_long(&tmp1, "count", num_attrib);
|
||||
dn = ldap_get_dn(ldap, ldap_result_entry);
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
if (dn) {
|
||||
add_assoc_string(&tmp1, "dn", dn);
|
||||
} else {
|
||||
add_assoc_null(&tmp1, "dn");
|
||||
}
|
||||
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS
|
||||
ldap_memfree(dn);
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #76248 (Malicious LDAP-Server Response causes Crash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!function_exists('pcntl_fork')) die('skip fork not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pid = pcntl_fork();
|
||||
const PORT = 12345;
|
||||
if ($pid == 0) {
|
||||
// child
|
||||
$server = stream_socket_server("tcp://127.0.0.1:12345");
|
||||
$socket = stream_socket_accept($server, 3);
|
||||
fwrite($socket, base64_decode("MAwCAQFhBwoBAAQABAAweQIBAmR0BJljbj1yb290LGRjPWV4YW1wbGUsZGM9Y29tMFcwIwQLb2JqZWN0Q2xhc3MxFAQSb3JnYW5pemF0aW9uYWxSb2xlMAwEAmNuMQYEBHJvb3QwIgQLZGVzY3JpcHRpb24xEwQRRGlyZWN0b3J5IE1hbmFnZXIwDAIBAmUHCgEABAAEADB5AgEDZHQEmWNuPXJvb3QsZGM9ZXhhbXBsZSxkYz1jb20wVzAjBAtvYmplY3RDbGFzczEUBBJvcmdhbml6YXRpb25hbFJvbGUwDAQCY24xBgQEcm9vdDAiBAtkZXNjcmlwdGlvbjETBBFEaXJlY3RvcnkgTWFuYWdlcjAMAgEDZQcKAQAEAAQA"));
|
||||
fflush($socket);
|
||||
} else {
|
||||
// parent
|
||||
$ds = ldap_connect("127.0.0.1", PORT);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$b = ldap_bind($ds, "cn=root,dc=example,dc=com", "secret");
|
||||
|
||||
$s = ldap_search($ds, "dc=example,dc=com", "(cn=root)");
|
||||
$tt = ldap_get_entries($ds, $s);
|
||||
var_dump($tt);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(1)
|
||||
[0]=>
|
||||
array(2) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
["dn"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,6 @@ if test "$PHP_LIBXML" != "no"; then
|
||||
PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||
PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
|
||||
], [
|
||||
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
|
||||
AC_MSG_ERROR([libxml2 not found. Please check your libxml2 installation.])
|
||||
])
|
||||
fi
|
||||
@@ -142,7 +142,7 @@ mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter)
|
||||
/* all of this is so ugly now! */
|
||||
static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter)
|
||||
{
|
||||
if (c >= 0x80 && c < 0xff)
|
||||
if (c >= 0x80 && c <= 0xff)
|
||||
filter->flag = 0;
|
||||
else
|
||||
filter->flag = 1; /* not it */
|
||||
|
||||
@@ -30,7 +30,7 @@ static const unsigned short cp1251_ucs_table[] = {
|
||||
0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021,
|
||||
0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f,
|
||||
0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
|
||||
0x003f, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0xfffd, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
|
||||
0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7,
|
||||
0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407,
|
||||
0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7,
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
* as it only covers this range, while the rest cover 0xa0 onwards */
|
||||
|
||||
static const unsigned short cp1252_ucs_table[] = {
|
||||
0x20ac,0xfffe,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffe,0x017d,0xfffe,
|
||||
0xfffe,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffe,0x017e,0x0178
|
||||
0x20ac,0xfffd,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,
|
||||
0x02c6,0x2030,0x0160,0x2039,0x0152,0xfffd,0x017d,0xfffd,
|
||||
0xfffd,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
|
||||
0x02dc,0x2122,0x0161,0x203a,0x0153,0xfffd,0x017e,0x0178
|
||||
};
|
||||
#endif /* UNICODE_TABLE_CP1252_H */
|
||||
@@ -452,7 +452,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
|
||||
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||
|
||||
rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
|
||||
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
|
||||
if (!rc || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
|
||||
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
|
||||
onig_error_code_to_str(err_str, err_code, &err_info);
|
||||
php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #62545 (wrong unicode mapping in some charsets)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
bin2hex(mb_convert_encoding("\x98", 'UTF-8', 'Windows-1251')),
|
||||
bin2hex(mb_convert_encoding("\x81\x8d\x8f\x90\x9d", 'UTF-8', 'Windows-1252'))
|
||||
);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(6) "efbfbd"
|
||||
string(30) "efbfbdefbfbdefbfbdefbfbdefbfbd"
|
||||
===DONE===
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
|
||||
var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
|
||||
?>
|
||||
--EXPECT--
|
||||
string(12) "Windows-1251"
|
||||
string(12) "Windows-1251"
|
||||
|
||||
@@ -79,11 +79,15 @@ mysqlnd_run_authentication(
|
||||
struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol);
|
||||
|
||||
if (!auth_plugin) {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
if (first_call) {
|
||||
mnd_pefree(requested_protocol, FALSE);
|
||||
requested_protocol = mnd_pestrdup(MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
DBG_INF("plugin found");
|
||||
|
||||
{
|
||||
zend_uchar * switch_to_auth_protocol_data = NULL;
|
||||
@@ -108,10 +112,13 @@ mysqlnd_run_authentication(
|
||||
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", plugin_data_len, plugin_data_len, plugin_data);
|
||||
/* The data should be allocated with malloc() */
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
if (auth_plugin) {
|
||||
scrambled_data =
|
||||
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
|
||||
plugin_data, plugin_data_len, session_options,
|
||||
conn->protocol_frame_codec->data, mysql_flags);
|
||||
}
|
||||
|
||||
if (conn->error_info->error_no) {
|
||||
goto end;
|
||||
}
|
||||
@@ -780,7 +787,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
|
||||
DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data);
|
||||
|
||||
|
||||
if (conn->protocol_frame_codec->data->ssl) {
|
||||
if (conn->vio->data->ssl) {
|
||||
DBG_INF("simple clear text under SSL");
|
||||
/* clear text under SSL */
|
||||
*auth_data_len = passwd_len;
|
||||
|
||||
@@ -517,6 +517,7 @@ MYSQLND_METHOD(mysqlnd_vio, enable_ssl)(MYSQLND_VIO * const net)
|
||||
zval cafile_zval;
|
||||
ZVAL_STRING(&cafile_zval, net->data->options.ssl_ca);
|
||||
php_stream_context_set_option(context, "ssl", "cafile", &cafile_zval);
|
||||
zval_ptr_dtor(&cafile_zval);
|
||||
any_flag = TRUE;
|
||||
}
|
||||
if (net->data->options.ssl_capath) {
|
||||
|
||||
@@ -1027,6 +1027,13 @@ int odbc_bindcols(odbc_result *result)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* Workaround for drivers that report VARCHAR(MAX) columns as SQL_VARCHAR (bug #73725) */
|
||||
if (SQL_VARCHAR == result->values[i].coltype && displaysize == 0) {
|
||||
result->values[i].coltype = SQL_LONGVARCHAR;
|
||||
result->values[i].value = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */
|
||||
if (result->values[i].coltype == SQL_TIMESTAMP) {
|
||||
displaysize += 3;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
Bug #73725 Unable to retrieve value of varchar(max) type
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include dirname(__FILE__) . "/config.inc";
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_do($conn, "CREATE TABLE bug73725(i int, txt varchar(max), k int)");
|
||||
|
||||
odbc_do($conn, "INSERT INTO bug73725 VALUES(101,'Any text', 33)");
|
||||
odbc_do($conn, "INSERT INTO bug73725 VALUES(102,'Müsliriegel', 34)");
|
||||
|
||||
$rc = odbc_do($conn, "SELECT i, txt, k FROM bug73725");
|
||||
|
||||
$r = odbc_fetch_array($rc);
|
||||
var_dump($r);
|
||||
|
||||
$r = odbc_fetch_array($rc);
|
||||
var_dump($r);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["i"]=>
|
||||
string(3) "101"
|
||||
["txt"]=>
|
||||
string(8) "Any text"
|
||||
["k"]=>
|
||||
string(2) "33"
|
||||
}
|
||||
array(3) {
|
||||
["i"]=>
|
||||
string(3) "102"
|
||||
["txt"]=>
|
||||
string(12) "Müsliriegel"
|
||||
["k"]=>
|
||||
string(2) "34"
|
||||
}
|
||||
==DONE==
|
||||
--CLEAN--
|
||||
<?php
|
||||
include 'config.inc';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_exec($conn, 'DROP TABLE bug73725');
|
||||
|
||||
odbc_close($conn);
|
||||
|
||||
?>
|
||||
@@ -792,8 +792,6 @@ optimize_const_unary_op:
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
|
||||
strip_nops(op_array, block);
|
||||
}
|
||||
|
||||
/* Rebuild plain (optimized) op_array from CFG */
|
||||
@@ -930,6 +928,11 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
|
||||
}
|
||||
if (i != j) {
|
||||
op_array->last_try_catch = j;
|
||||
if (j == 0) {
|
||||
efree(op_array->try_catch_array);
|
||||
op_array->try_catch_array = NULL;
|
||||
}
|
||||
|
||||
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
|
||||
zend_op *opline = new_opcodes;
|
||||
zend_op *end = opline + len;
|
||||
@@ -1838,6 +1841,13 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
|
||||
zend_optimize_block(b, op_array, usage, &cfg, Tsource);
|
||||
}
|
||||
|
||||
/* Eliminate NOPs */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
strip_nops(op_array, b);
|
||||
}
|
||||
}
|
||||
|
||||
/* Jump optimization for each block */
|
||||
for (b = blocks; b < end; b++) {
|
||||
if (b->flags & ZEND_BB_REACHABLE) {
|
||||
|
||||
@@ -144,12 +144,13 @@ static void zend_ssa_remove_nops(zend_op_array *op_array, zend_ssa *ssa)
|
||||
while (i < end) {
|
||||
shiftlist[i] = i - target;
|
||||
if (EXPECTED(op_array->opcodes[i].opcode != ZEND_NOP) ||
|
||||
/*keep NOP to support ZEND_VM_SMART_BRANCH */
|
||||
(i > 0 &&
|
||||
/* Keep NOP to support ZEND_VM_SMART_BRANCH. Using "target-1" instead of
|
||||
* "i-1" here to check the last non-NOP instruction. */
|
||||
(target > 0 &&
|
||||
i + 1 < op_array->last &&
|
||||
(op_array->opcodes[i+1].opcode == ZEND_JMPZ ||
|
||||
op_array->opcodes[i+1].opcode == ZEND_JMPNZ) &&
|
||||
zend_is_smart_branch(op_array->opcodes + i - 1))) {
|
||||
zend_is_smart_branch(op_array->opcodes + target - 1))) {
|
||||
if (i != target) {
|
||||
op_array->opcodes[target] = op_array->opcodes[i];
|
||||
ssa->ops[target] = ssa->ops[i];
|
||||
|
||||
@@ -157,6 +157,17 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static inline zend_bool add_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a > ZEND_LONG_MAX - b)
|
||||
|| (b < 0 && a < ZEND_LONG_MIN - b);
|
||||
}
|
||||
#if 0
|
||||
static inline zend_bool sub_will_overflow(zend_long a, zend_long b) {
|
||||
return (b > 0 && a < ZEND_LONG_MIN + b)
|
||||
|| (b < 0 && a > ZEND_LONG_MAX + b);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void zend_ssa_check_scc_var(const zend_op_array *op_array, zend_ssa *ssa, int var, int *index, int *dfs, int *root, zend_worklist_stack *stack) /* {{{ */
|
||||
{
|
||||
#ifdef SYM_RANGE
|
||||
@@ -826,7 +837,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow && tmp->underflow;
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (constraint->max_ssa_var < 0) {
|
||||
@@ -834,7 +847,9 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow && tmp->overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
if (!add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max);
|
||||
}
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow && tmp->overflow;
|
||||
#endif
|
||||
}
|
||||
@@ -844,8 +859,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->min = constraint->range.min;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
if (add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) {
|
||||
tmp->underflow = 1;
|
||||
tmp->min = ZEND_LONG_MIN;
|
||||
} else {
|
||||
tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow;
|
||||
tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->underflow = 1;
|
||||
@@ -856,8 +876,13 @@ int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int
|
||||
tmp->overflow = constraint->range.overflow;
|
||||
#ifdef SYM_RANGE
|
||||
} else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
if (add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) {
|
||||
tmp->overflow = 1;
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
} else {
|
||||
tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max;
|
||||
tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
tmp->max = ZEND_LONG_MAX;
|
||||
|
||||
@@ -108,6 +108,9 @@ zend_accel_shared_globals *accel_shared_globals = NULL;
|
||||
zend_bool accel_startup_ok = 0;
|
||||
static char *zps_failure_reason = NULL;
|
||||
char *zps_api_failure_reason = NULL;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
zend_bool file_cache_only = 0; /* process uses file cache only */
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
zend_bool fallback_process = 0; /* process uses file cache fallback */
|
||||
#endif
|
||||
@@ -448,7 +451,7 @@ zend_string *accel_new_interned_string(zend_string *str)
|
||||
Bucket *p;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
@@ -1232,8 +1235,8 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
|
||||
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
|
||||
#endif
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0);
|
||||
/* Copy into memory block */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, NULL, 0, 0);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1352,7 +1355,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
}
|
||||
|
||||
/* Copy into shared memory */
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length);
|
||||
new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length, 1);
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
@@ -1700,7 +1703,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
/* The Accelerator is disabled, act as if without the Accelerator */
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
} else if (ZCG(accel_directives).file_cache_only) {
|
||||
} else if (file_cache_only) {
|
||||
return file_cache_compile_file(file_handle, type);
|
||||
#endif
|
||||
} else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
|
||||
@@ -1999,6 +2002,9 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
|
||||
static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
|
||||
{
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
!file_cache_only &&
|
||||
#endif
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
|
||||
!ZCSG(restart_in_progress)) {
|
||||
|
||||
@@ -2130,7 +2136,7 @@ static void accel_activate(void)
|
||||
ZCG(cwd_check) = 1;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -2520,6 +2526,8 @@ static inline int accel_find_sapi(void)
|
||||
|
||||
static int zend_accel_init_shm(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
zend_shared_alloc_lock();
|
||||
|
||||
accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals));
|
||||
@@ -2583,6 +2591,11 @@ static int zend_accel_init_shm(void)
|
||||
ZCSG(last_restart_time) = 0;
|
||||
ZCSG(restart_in_progress) = 0;
|
||||
|
||||
|
||||
for (i = 0; i < -HT_MIN_MASK; i++) {
|
||||
ZCSG(uninitialized_bucket)[i] = HT_INVALID_IDX;
|
||||
}
|
||||
|
||||
zend_shared_alloc_unlock();
|
||||
|
||||
return SUCCESS;
|
||||
@@ -2801,7 +2814,8 @@ static int accel_startup(zend_extension *extension)
|
||||
/* End of non-SHM dependent initializations */
|
||||
/********************************************/
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (!ZCG(accel_directives).file_cache_only) {
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
if (!file_cache_only) {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
@@ -2839,6 +2853,7 @@ static int accel_startup(zend_extension *extension)
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
case ALLOC_FALLBACK:
|
||||
zend_shared_alloc_lock();
|
||||
file_cache_only = 1;
|
||||
fallback_process = 1;
|
||||
zend_accel_init_auto_globals();
|
||||
zend_shared_alloc_unlock();
|
||||
@@ -2937,7 +2952,7 @@ static void accel_free_ts_resources()
|
||||
void accel_shutdown(void)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
zend_bool file_cache_only = 0;
|
||||
zend_bool _file_cache_only = 0;
|
||||
|
||||
zend_optimizer_shutdown();
|
||||
|
||||
@@ -2964,12 +2979,12 @@ void accel_shutdown(void)
|
||||
zend_interned_strings_restore = orig_interned_strings_restore;
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
file_cache_only = ZCG(accel_directives).file_cache_only;
|
||||
_file_cache_only = file_cache_only;
|
||||
#endif
|
||||
|
||||
accel_free_ts_resources();
|
||||
|
||||
if (!file_cache_only) {
|
||||
if (!_file_cache_only) {
|
||||
zend_shared_alloc_shutdown();
|
||||
}
|
||||
zend_compile_file = accelerator_orig_compile_file;
|
||||
|
||||
@@ -120,6 +120,8 @@ extern int lock_file;
|
||||
|
||||
#if defined(HAVE_OPCACHE_FILE_CACHE) && defined(ZEND_WIN32)
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 1
|
||||
#else
|
||||
# define ENABLE_FILE_CACHE_FALLBACK 0
|
||||
#endif
|
||||
|
||||
#if ZEND_WIN32
|
||||
@@ -281,9 +283,14 @@ typedef struct _zend_accel_shared_globals {
|
||||
char *interned_strings_end;
|
||||
char *interned_strings_saved_top;
|
||||
HashTable interned_strings;
|
||||
/* uninitialized HashTable Support */
|
||||
uint32_t uninitialized_bucket[-HT_MIN_MASK];
|
||||
} zend_accel_shared_globals;
|
||||
|
||||
extern zend_bool accel_startup_ok;
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
extern zend_bool file_cache_only;
|
||||
#endif
|
||||
#if ENABLE_FILE_CACHE_FALLBACK
|
||||
extern zend_bool fallback_process;
|
||||
#endif
|
||||
|
||||
@@ -71,7 +71,7 @@ static void zend_win_error_message(int type, char *msg, int err)
|
||||
|
||||
LocalFree( lpMsgBuf );
|
||||
|
||||
zend_accel_error(type, msg);
|
||||
zend_accel_error(type, "%s", msg);
|
||||
}
|
||||
|
||||
static char *create_name_with_username(char *name)
|
||||
@@ -182,9 +182,6 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
|
||||
}
|
||||
accel_shared_globals = (zend_accel_shared_globals *)((char *)((zend_smm_shared_globals *)mapping_base)->app_shared_globals + ((char *)mapping_base - (char *)wanted_mb_save));
|
||||
|
||||
/* Make this process to use file-cache only */
|
||||
ZCG(accel_directives).file_cache_only = 1;
|
||||
|
||||
return ALLOC_FALLBACK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #75969: Assertion failure in live range DCE due to block pass misoptimization
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// This is required for the segfault
|
||||
md5('foo');
|
||||
|
||||
class Extended_Class {};
|
||||
$response = array(
|
||||
'a' => 'b'
|
||||
);
|
||||
new Extended_Class( array(
|
||||
'foo' => $response,
|
||||
'foo2' => 'bar2'
|
||||
) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #76074 (opcache corrupts variable in for-loop)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int $nr) {
|
||||
for ($i = $nr; $i <= $nr + 1; $i++)
|
||||
var_dump($i);
|
||||
}
|
||||
|
||||
test(1);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #76275: Assertion failure in file cache when unserializing empty try_catch_array
|
||||
--INI--
|
||||
opcache.enabled=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_cache=/tmp
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (PHP_VERSION_ID >= 70000) {
|
||||
echo "Done";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_callable('random_bytes')) {
|
||||
try {
|
||||
} catch (com_exception $e) {
|
||||
}
|
||||
|
||||
function random_bytes($length)
|
||||
{
|
||||
throw new Exception(
|
||||
'There is no suitable CSPRNG installed on your system'
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #76281: Opcache causes incorrect "undefined variable" errors
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($r, $action) {
|
||||
$user_sub_resource = in_array($action, array('get_securityquestions', 'get_status', 'get_groupstats'));
|
||||
|
||||
$user_id = null;
|
||||
if ($user_sub_resource && isset($r['user_id'])) {
|
||||
$user_id = $r['user_id'];
|
||||
}
|
||||
else if (isset($r['id'])) {
|
||||
$user_id = $r['id'];
|
||||
}
|
||||
|
||||
if ($user_sub_resource) {
|
||||
return 'foo';
|
||||
}
|
||||
|
||||
return 'bar';
|
||||
}
|
||||
|
||||
var_dump(test(['user_id' => 1, 'id' => 2], 'foo'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
@@ -7,16 +7,22 @@ function php_cli_server_start($ini = "") {
|
||||
$php_executable = getenv('TEST_PHP_EXECUTABLE');
|
||||
$doc_root = __DIR__;
|
||||
|
||||
$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} $ini -S " . PHP_CLI_SERVER_ADDRESS;
|
||||
$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} $ini -S " . PHP_CLI_SERVER_ADDRESS . " 2>/dev/null";
|
||||
$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ void zend_accel_override_file_functions(void)
|
||||
zend_function *old_function;
|
||||
if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
zend_accel_error(ACCEL_LOG_WARNING, "file_override_enabled has no effect when file_cache_only is set");
|
||||
return;
|
||||
}
|
||||
@@ -442,7 +442,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
|
||||
if (ZCG(enabled) && accel_startup_ok &&
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
((ZCG(counted) || ZCSG(accelerator_enabled)) || ZCG(accel_directives).file_cache_only)
|
||||
((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
|
||||
#else
|
||||
(ZCG(counted) || ZCSG(accelerator_enabled))
|
||||
#endif
|
||||
@@ -457,7 +457,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
php_info_print_table_row(2, "Optimization", "Disabled");
|
||||
}
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
if (!ZCG(accel_directives).file_cache_only) {
|
||||
if (!file_cache_only) {
|
||||
php_info_print_table_row(2, "SHM Cache", "Enabled");
|
||||
} else {
|
||||
php_info_print_table_row(2, "SHM Cache", "Disabled");
|
||||
@@ -467,7 +467,7 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
} else {
|
||||
php_info_print_table_row(2, "File Cache", "Disabled");
|
||||
}
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
if (!accel_startup_ok || zps_api_failure_reason) {
|
||||
php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
|
||||
} else {
|
||||
@@ -616,7 +616,7 @@ static ZEND_FUNCTION(opcache_get_status)
|
||||
if (ZCG(accel_directives).file_cache) {
|
||||
add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
|
||||
}
|
||||
if (ZCG(accel_directives).file_cache_only) {
|
||||
if (file_cache_only) {
|
||||
add_assoc_bool(return_value, "file_cache_only", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ static void zend_hash_clone_constants(HashTable *ht, HashTable *source)
|
||||
ht->nNumUsed = 0;
|
||||
ht->nNumOfElements = source->nNumOfElements;
|
||||
ht->nNextFreeElement = source->nNextFreeElement;
|
||||
ht->pDestructor = ZVAL_PTR_DTOR;
|
||||
ht->pDestructor = NULL;
|
||||
ht->u.flags = (source->u.flags & HASH_FLAG_INITIALIZED) | HASH_FLAG_APPLY_PROTECTION;
|
||||
ht->nInternalPointer = source->nNumOfElements ? 0 : HT_INVALID_IDX;
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "zend_interfaces.h"
|
||||
|
||||
#include "php.h"
|
||||
#ifdef ZEND_WIN32
|
||||
#include "ext/standard/md5.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
|
||||
@@ -93,8 +96,10 @@ static int zend_file_cache_flock(int fd, int type)
|
||||
|
||||
#define IS_SERIALIZED_INTERNED(ptr) \
|
||||
((size_t)(ptr) & Z_UL(1))
|
||||
|
||||
/* Allowing == here to account for a potential empty allocation at the end of the memory */
|
||||
#define IS_SERIALIZED(ptr) \
|
||||
((char*)(ptr) < (char*)script->size)
|
||||
((char*)(ptr) <= (char*)script->size)
|
||||
#define IS_UNSERIALIZED(ptr) \
|
||||
(((char*)(ptr) >= (char*)script->mem && (char*)(ptr) < (char*)script->mem + script->size) || \
|
||||
IS_ACCEL_INTERNED(ptr))
|
||||
@@ -521,14 +526,13 @@ static void zend_file_cache_serialize_prop_info(zval *zv,
|
||||
prop = Z_PTR_P(zv);
|
||||
UNSERIALIZE_PTR(prop);
|
||||
|
||||
if (prop->ce && !IS_SERIALIZED(prop->ce)) {
|
||||
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
|
||||
if (!IS_SERIALIZED(prop->ce)) {
|
||||
SERIALIZE_PTR(prop->ce);
|
||||
}
|
||||
if (prop->name && !IS_SERIALIZED(prop->name)) {
|
||||
SERIALIZE_STR(prop->name);
|
||||
}
|
||||
if (prop->doc_comment && !IS_SERIALIZED(prop->doc_comment)) {
|
||||
SERIALIZE_STR(prop->doc_comment);
|
||||
if (prop->doc_comment) {
|
||||
SERIALIZE_STR(prop->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,12 +549,15 @@ static void zend_file_cache_serialize_class_constant(zval *z
|
||||
c = Z_PTR_P(zv);
|
||||
UNSERIALIZE_PTR(c);
|
||||
|
||||
zend_file_cache_serialize_zval(&c->value, script, info, buf);
|
||||
if (c->ce && !IS_SERIALIZED(c->ce)) {
|
||||
ZEND_ASSERT(c->ce != NULL);
|
||||
if (!IS_SERIALIZED(c->ce)) {
|
||||
SERIALIZE_PTR(c->ce);
|
||||
}
|
||||
if (c->doc_comment && !IS_SERIALIZED(c->doc_comment)) {
|
||||
SERIALIZE_STR(c->doc_comment);
|
||||
|
||||
zend_file_cache_serialize_zval(&c->value, script, info, buf);
|
||||
|
||||
if (c->doc_comment) {
|
||||
SERIALIZE_STR(c->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -721,16 +728,43 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
|
||||
size_t len;
|
||||
char *filename;
|
||||
|
||||
#ifndef ZEND_WIN32
|
||||
len = strlen(ZCG(accel_directives).file_cache);
|
||||
filename = emalloc(len + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX));
|
||||
memcpy(filename, ZCG(accel_directives).file_cache, len);
|
||||
#ifndef ZEND_WIN32
|
||||
filename[len] = '/';
|
||||
memcpy(filename + len + 1, ZCG(system_id), 32);
|
||||
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
|
||||
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
|
||||
#else
|
||||
PHP_MD5_CTX ctx;
|
||||
char md5uname[32];
|
||||
unsigned char digest[16], c;
|
||||
size_t i;
|
||||
char *uname = php_win32_get_username();
|
||||
|
||||
PHP_MD5Init(&ctx);
|
||||
PHP_MD5Update(&ctx, uname, strlen(uname));
|
||||
PHP_MD5Final(digest, &ctx);
|
||||
for (i = 0; i < 16; i++) {
|
||||
c = digest[i] >> 4;
|
||||
c = (c <= 9) ? c + '0' : c - 10 + 'a';
|
||||
md5uname[i * 2] = c;
|
||||
c = digest[i] & 0x0f;
|
||||
c = (c <= 9) ? c + '0' : c - 10 + 'a';
|
||||
md5uname[(i * 2) + 1] = c;
|
||||
}
|
||||
|
||||
len = strlen(ZCG(accel_directives).file_cache);
|
||||
|
||||
filename = emalloc(len + 33 + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX));
|
||||
|
||||
memcpy(filename, ZCG(accel_directives).file_cache, len);
|
||||
filename[len] = '\\';
|
||||
memcpy(filename + 1 + len, md5uname, 32);
|
||||
len += 32;
|
||||
filename[len] = '\\';
|
||||
|
||||
memcpy(filename + len + 1, ZCG(system_id), 32);
|
||||
if (ZSTR_LEN(script_path) >= 2 && ':' == ZSTR_VAL(script_path)[1]) {
|
||||
/* local fs */
|
||||
@@ -743,6 +777,7 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
|
||||
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
|
||||
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
|
||||
}
|
||||
free(uname);
|
||||
#endif
|
||||
|
||||
return filename;
|
||||
@@ -862,7 +897,11 @@ static void zend_file_cache_unserialize_hash(HashTable *ht,
|
||||
|
||||
ht->pDestructor = dtor;
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!file_cache_only)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (IS_UNSERIALIZED(ht->arData)) {
|
||||
@@ -1107,14 +1146,13 @@ static void zend_file_cache_unserialize_prop_info(zval *zv,
|
||||
UNSERIALIZE_PTR(Z_PTR_P(zv));
|
||||
prop = Z_PTR_P(zv);
|
||||
|
||||
if (prop->ce && !IS_UNSERIALIZED(prop->ce)) {
|
||||
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
|
||||
if (!IS_UNSERIALIZED(prop->ce)) {
|
||||
UNSERIALIZE_PTR(prop->ce);
|
||||
}
|
||||
if (prop->name && !IS_UNSERIALIZED(prop->name)) {
|
||||
UNSERIALIZE_STR(prop->name);
|
||||
}
|
||||
if (prop->doc_comment && !IS_UNSERIALIZED(prop->doc_comment)) {
|
||||
UNSERIALIZE_STR(prop->doc_comment);
|
||||
if (prop->doc_comment) {
|
||||
UNSERIALIZE_STR(prop->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1129,12 +1167,15 @@ static void zend_file_cache_unserialize_class_constant(zval *
|
||||
UNSERIALIZE_PTR(Z_PTR_P(zv));
|
||||
c = Z_PTR_P(zv);
|
||||
|
||||
zend_file_cache_unserialize_zval(&c->value, script, buf);
|
||||
if (c->ce && !IS_UNSERIALIZED(c->ce)) {
|
||||
ZEND_ASSERT(c->ce != NULL);
|
||||
if (!IS_UNSERIALIZED(c->ce)) {
|
||||
UNSERIALIZE_PTR(c->ce);
|
||||
}
|
||||
if (c->doc_comment && !IS_UNSERIALIZED(c->doc_comment)) {
|
||||
UNSERIALIZE_STR(c->doc_comment);
|
||||
|
||||
zend_file_cache_unserialize_zval(&c->value, script, buf);
|
||||
|
||||
if (c->doc_comment) {
|
||||
UNSERIALIZE_STR(c->doc_comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1178,7 +1219,7 @@ static void zend_file_cache_unserialize_class(zval *zv,
|
||||
UNSERIALIZE_STR(ce->info.user.filename);
|
||||
UNSERIALIZE_STR(ce->info.user.doc_comment);
|
||||
zend_file_cache_unserialize_hash(&ce->properties_info,
|
||||
script, buf, zend_file_cache_unserialize_prop_info, ZVAL_PTR_DTOR);
|
||||
script, buf, zend_file_cache_unserialize_prop_info, NULL);
|
||||
|
||||
if (ce->trait_aliases) {
|
||||
zend_trait_alias **p, *q;
|
||||
@@ -1388,7 +1429,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ZCG(accel_directives).file_cache_only &&
|
||||
if (!file_cache_only &&
|
||||
!ZCSG(restart_in_progress) &&
|
||||
!ZSMMG(memory_exhausted) &&
|
||||
accelerator_shm_read_lock() == SUCCESS) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
#define zend_set_str_gc_flags(str) do { \
|
||||
if (ZCG(accel_directives).file_cache_only) { \
|
||||
if (file_cache_only) { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED; \
|
||||
} else { \
|
||||
GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
|
||||
@@ -86,14 +86,24 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
|
||||
uint32_t idx, nIndex;
|
||||
Bucket *p;
|
||||
|
||||
ht->pDestructor = NULL;
|
||||
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ht->nNumUsed == 0) {
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
ht->nTableMask = HT_MIN_MASK;
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
ht->u.flags &= ~HASH_FLAG_INITIALIZED;
|
||||
return;
|
||||
}
|
||||
@@ -170,14 +180,24 @@ static void zend_hash_persist_immutable(HashTable *ht)
|
||||
uint32_t idx, nIndex;
|
||||
Bucket *p;
|
||||
|
||||
ht->pDestructor = NULL;
|
||||
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ht->nNumUsed == 0) {
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
ht->nTableMask = HT_MIN_MASK;
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
if (EXPECTED(!ZCG(current_persistent_script)->corrupted)) {
|
||||
HT_SET_DATA_ADDR(ht, &ZCSG(uninitialized_bucket));
|
||||
} else {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
}
|
||||
ht->u.flags &= ~HASH_FLAG_INITIALIZED;
|
||||
return;
|
||||
}
|
||||
@@ -829,7 +849,7 @@ static void zend_accel_persist_class_table(HashTable *class_table)
|
||||
zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
|
||||
}
|
||||
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length, int for_shm)
|
||||
{
|
||||
script->mem = ZCG(mem);
|
||||
|
||||
@@ -840,6 +860,15 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
|
||||
if (key && *key) {
|
||||
*key = zend_accel_memdup(*key, key_length + 1);
|
||||
}
|
||||
|
||||
script->corrupted = 0;
|
||||
ZCG(current_persistent_script) = script;
|
||||
|
||||
if (!for_shm) {
|
||||
/* script is not going to be saved in SHM */
|
||||
script->corrupted = 1;
|
||||
}
|
||||
|
||||
zend_accel_store_string(script->script.filename);
|
||||
|
||||
#ifdef __SSE2__
|
||||
@@ -856,6 +885,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
|
||||
zend_hash_persist(&script->script.function_table, zend_persist_op_array);
|
||||
zend_persist_op_array_ex(&script->script.main_op_array, script);
|
||||
|
||||
script->corrupted = 0;
|
||||
ZCG(current_persistent_script) = NULL;
|
||||
|
||||
return script;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
int zend_accel_script_persistable(zend_persistent_script *script);
|
||||
uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length, int for_shm);
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
|
||||
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length, int for_shm);
|
||||
|
||||
#endif /* ZEND_PERSIST_H */
|
||||
+18
-17
@@ -73,7 +73,7 @@
|
||||
#ifdef HAVE_OPENSSL_MD2_H
|
||||
#define OPENSSL_ALGO_MD2 4
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
#define OPENSSL_ALGO_DSS1 5
|
||||
#endif
|
||||
#define OPENSSL_ALGO_SHA224 6
|
||||
@@ -155,12 +155,12 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_check_private_key, 0)
|
||||
ZEND_ARG_INFO(0, key)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_parse, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_parse, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, x509)
|
||||
ZEND_ARG_INFO(0, shortname)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_checkpurpose, 0, 0, 3)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_checkpurpose, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, x509cert)
|
||||
ZEND_ARG_INFO(0, purpose)
|
||||
ZEND_ARG_INFO(0, cainfo) /* array */
|
||||
@@ -183,7 +183,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs12_export_to_file, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, args) /* array */
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkcs12_export, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs12_export, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, x509)
|
||||
ZEND_ARG_INFO(1, out)
|
||||
ZEND_ARG_INFO(0, priv_key)
|
||||
@@ -225,12 +225,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_new, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, extraattribs)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_csr_get_subject, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_get_subject, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, csr)
|
||||
ZEND_ARG_INFO(0, use_shortnames)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_openssl_csr_get_public_key, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_csr_get_public_key, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, csr)
|
||||
ZEND_ARG_INFO(0, use_shortnames)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkey_new, 0, 0, 0)
|
||||
@@ -558,7 +560,7 @@ ZEND_GET_MODULE(openssl)
|
||||
#endif
|
||||
|
||||
/* {{{ OpenSSL compatibility functions and macros */
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
#define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa
|
||||
#define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh
|
||||
#define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa
|
||||
@@ -675,7 +677,7 @@ static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
|
||||
return M_ASN1_STRING_data(asn1);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10002
|
||||
|
||||
static int X509_get_signature_nid(const X509 *x)
|
||||
{
|
||||
@@ -1235,7 +1237,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if defined(PHP_WIN32) || (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER))
|
||||
#if defined(PHP_WIN32) || PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
#define PHP_OPENSSL_RAND_ADD_TIME() ((void) 0)
|
||||
#else
|
||||
#define PHP_OPENSSL_RAND_ADD_TIME() php_openssl_rand_add_timeval()
|
||||
@@ -1322,7 +1324,7 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo) { /* {{{ */
|
||||
mdtype = (EVP_MD *) EVP_md2();
|
||||
break;
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
case OPENSSL_ALGO_DSS1:
|
||||
mdtype = (EVP_MD *) EVP_dss1();
|
||||
break;
|
||||
@@ -1448,7 +1450,7 @@ PHP_MINIT_FUNCTION(openssl)
|
||||
#ifdef HAVE_OPENSSL_MD2_H
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
|
||||
#endif
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION < 0x10100
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
|
||||
@@ -3618,7 +3620,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
/* Due to changes in OpenSSL 1.1 related to locking when decoding CSR,
|
||||
* the pub key is not changed after assigning. It means if we pass
|
||||
* a private key, it will be returned including the private part.
|
||||
@@ -3629,7 +3631,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
|
||||
/* Retrieve the public key from the CSR */
|
||||
tpubkey = X509_REQ_get_pubkey(csr);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
#if PHP_OPENSSL_API_VERSION >= 0x10100
|
||||
/* We need to free the CSR as it was duplicated */
|
||||
X509_REQ_free(csr);
|
||||
#endif
|
||||
@@ -3783,6 +3785,9 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
|
||||
if (Z_STRLEN_P(val) > 7 && memcmp(Z_STRVAL_P(val), "file://", sizeof("file://") - 1) == 0) {
|
||||
filename = Z_STRVAL_P(val) + (sizeof("file://") - 1);
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
}
|
||||
/* it's an X509 file/cert of some kind, and we need to extract the data from that */
|
||||
if (public_key) {
|
||||
@@ -3809,9 +3814,6 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
BIO *in;
|
||||
|
||||
if (filename) {
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
@@ -6652,4 +6654,3 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,25 @@ extern zend_module_entry openssl_module_entry;
|
||||
#include "php_version.h"
|
||||
#define PHP_OPENSSL_VERSION PHP_VERSION
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#if defined(LIBRESSL_VERSION_NUMBER)
|
||||
/* LibreSSL version check */
|
||||
#if LIBRESSL_VERSION_NUMBER < 0x20700000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10001
|
||||
#else
|
||||
#define PHP_OPENSSL_API_VERSION 0x10100
|
||||
#endif
|
||||
#else
|
||||
/* OpenSSL version check */
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10002000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10001
|
||||
#elif OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
#define PHP_OPENSSL_API_VERSION 0x10002
|
||||
#else
|
||||
#define PHP_OPENSSL_API_VERSION 0x10100
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define OPENSSL_RAW_DATA 1
|
||||
#define OPENSSL_ZERO_PADDING 2
|
||||
#define OPENSSL_DONT_ZERO_PAD_KEY 4
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #76296 openssl_pkey_get_public does not respect open_basedir
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dir = __DIR__ . '/bug76296_openbasedir';
|
||||
$pem = 'file://' . __DIR__ . '/public.key';
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir);
|
||||
}
|
||||
|
||||
ini_set('open_basedir', $dir);
|
||||
|
||||
var_dump(openssl_pkey_get_public($pem));
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: openssl_pkey_get_public(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d
|
||||
bool(false)
|
||||
--CLEAN--
|
||||
@rmdir(__DIR__ . '/bug76296_openbasedir');
|
||||
@@ -79,6 +79,9 @@ while (($enc_error_new = openssl_error_string()) !== false) {
|
||||
var_dump($error_queue_size);
|
||||
echo "\n";
|
||||
|
||||
$is_111 = OPENSSL_VERSION_NUMBER >= 0x10101000;
|
||||
$err_pem_no_start_line = $is_111 ? '0909006C': '0906D06C';
|
||||
|
||||
// PKEY
|
||||
echo "PKEY errors\n";
|
||||
// file for pkey (file:///) fails when opennig (BIO_new_file)
|
||||
@@ -86,7 +89,7 @@ echo "PKEY errors\n";
|
||||
expect_openssl_errors('openssl_pkey_export_to_file opening', ['02001002', '2006D080']);
|
||||
// file or private pkey is not correct PEM - failing PEM_read_bio_PrivateKey
|
||||
@openssl_pkey_export_to_file($csr_file, $output_file);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file pem', [$err_pem_no_start_line]);
|
||||
// file to export cannot be written
|
||||
@openssl_pkey_export_to_file($private_key_file, $invalid_file_for_write);
|
||||
expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
|
||||
@@ -95,7 +98,7 @@ expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
|
||||
expect_openssl_errors('openssl_pkey_export', ['06065064', '0906A065']);
|
||||
// invalid x509 for getting public key
|
||||
@openssl_pkey_get_public($private_key_file);
|
||||
expect_openssl_errors('openssl_pkey_get_public', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_pkey_get_public', [$err_pem_no_start_line]);
|
||||
// private encrypt with unknown padding
|
||||
@openssl_private_encrypt("data", $crypted, $private_key_file, 1000);
|
||||
expect_openssl_errors('openssl_private_encrypt', ['04066076']);
|
||||
@@ -105,7 +108,7 @@ expect_openssl_errors('openssl_private_decrypt', ['04065072']);
|
||||
// public encrypt and decrypt with failed padding check and padding
|
||||
@openssl_public_encrypt("data", $crypted, $public_key_file, 1000);
|
||||
@openssl_public_decrypt("data", $crypted, $public_key_file);
|
||||
expect_openssl_errors('openssl_private_(en|de)crypt padding', ['0906D06C', '04068076', '04067072']);
|
||||
expect_openssl_errors('openssl_private_(en|de)crypt padding', [$err_pem_no_start_line, '04068076', '04067072']);
|
||||
|
||||
// X509
|
||||
echo "X509 errors\n";
|
||||
@@ -114,7 +117,7 @@ echo "X509 errors\n";
|
||||
expect_openssl_errors('openssl_x509_export_to_file open', ['02001002']);
|
||||
// file or str cert is not correct PEM - failing PEM_read_bio_X509 or PEM_ASN1_read_bio
|
||||
@openssl_x509_export_to_file($csr_file, $output_file);
|
||||
expect_openssl_errors('openssl_x509_export_to_file pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_x509_export_to_file pem', [$err_pem_no_start_line]);
|
||||
// file to export cannot be written
|
||||
@openssl_x509_export_to_file($crt_file, $invalid_file_for_write);
|
||||
expect_openssl_errors('openssl_x509_export_to_file write', ['2006D002']);
|
||||
@@ -129,7 +132,7 @@ echo "CSR errors\n";
|
||||
expect_openssl_errors('openssl_csr_get_subject open', ['02001002', '2006D080']);
|
||||
// file or str csr is not correct PEM - failing PEM_read_bio_X509_REQ
|
||||
@openssl_csr_get_subject($crt_file);
|
||||
expect_openssl_errors('openssl_csr_get_subjec pem', ['0906D06C']);
|
||||
expect_openssl_errors('openssl_csr_get_subjec pem', [$err_pem_no_start_line]);
|
||||
|
||||
// other possible cuases that are difficult to catch:
|
||||
// - ASN1_STRING_to_UTF8 fails in add_assoc_name_entry
|
||||
|
||||
@@ -12,7 +12,7 @@ $cert = "file://" . dirname(__FILE__) . "/cert.crt";
|
||||
$bert = "file://" . dirname(__FILE__) . "/bug41033.pem";
|
||||
$sert = "file://" . dirname(__FILE__) . "/san-cert.pem";
|
||||
$cpca = dirname(__FILE__) . "/san-ca.pem";
|
||||
$utfl = dirname(__FILE__) . "/sni_server_domain1.pem";
|
||||
$utfl = dirname(__FILE__) . "/sni_server_uk.pem";
|
||||
$rcrt = openssl_x509_read($cert);
|
||||
|
||||
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose); */
|
||||
|
||||
@@ -3,7 +3,6 @@ sni_server
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (OPENSSL_VERSION_NUMBER >= 0x10100000) die("skip OpenSSL < v1.1.0 required");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
@@ -11,9 +10,9 @@ $serverCode = <<<'CODE'
|
||||
$ctx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/domain1.pem',
|
||||
'SNI_server_certs' => [
|
||||
"domain1.com" => __DIR__ . "/sni_server_domain1.pem",
|
||||
"domain2.com" => __DIR__ . "/sni_server_domain2.pem",
|
||||
"domain3.com" => __DIR__ . "/sni_server_domain3.pem"
|
||||
"cs.php.net" => __DIR__ . "/sni_server_cs.pem",
|
||||
"uk.php.net" => __DIR__ . "/sni_server_uk.pem",
|
||||
"us.php.net" => __DIR__ . "/sni_server_us.pem"
|
||||
]
|
||||
]]);
|
||||
|
||||
@@ -34,19 +33,19 @@ $clientCode = <<<'CODE'
|
||||
|
||||
phpt_wait();
|
||||
|
||||
$ctxArr['peer_name'] = 'domain1.com';
|
||||
$ctxArr['peer_name'] = 'cs.php.net';
|
||||
$ctx = stream_context_create(['ssl' => $ctxArr]);
|
||||
$client = stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
|
||||
$cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
|
||||
var_dump(openssl_x509_parse($cert)['subject']['CN']);
|
||||
|
||||
$ctxArr['peer_name'] = 'domain2.com';
|
||||
$ctxArr['peer_name'] = 'uk.php.net';
|
||||
$ctx = stream_context_create(['ssl' => $ctxArr]);
|
||||
$client = @stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
|
||||
$cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
|
||||
var_dump(openssl_x509_parse($cert)['subject']['CN']);
|
||||
|
||||
$ctxArr['peer_name'] = 'domain3.com';
|
||||
$ctxArr['peer_name'] = 'us.php.net';
|
||||
$ctx = stream_context_create(['ssl' => $ctxArr]);
|
||||
$client = @stream_socket_client("tls://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx);
|
||||
$cert = stream_context_get_options($ctx)['ssl']['peer_certificate'];
|
||||
@@ -56,6 +55,6 @@ CODE;
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
string(%d) "domain1.com"
|
||||
string(%d) "domain2.com"
|
||||
string(%d) "domain3.com"
|
||||
string(%d) "cs.php.net"
|
||||
string(%d) "uk.php.net"
|
||||
string(%d) "us.php.net"
|
||||
@@ -1,63 +1,63 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFPjCCAyYCAQEwDQYJKoZIhvcNAQEFBQAwWTELMAkGA1UEBhMCVVMxCzAJBgNV
|
||||
BAgMAlNDMRUwEwYDVQQHDAxNeXJ0bGUgQmVhY2gxEjAQBgNVBAoMCXBocC50ZXN0
|
||||
czESMBAGA1UEAwwJcGhwLnRlc3RzMB4XDTE0MDMwNTE0MTg1M1oXDTI0MDMwMjE0
|
||||
MTg1M1owcTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlNDMRUwEwYDVQQHDAxNeXJ0
|
||||
bGUgQmVhY2gxHjAcBgNVBAoMFXBocC50ZXN0cyBzdWJvcmRpbmF0ZTEeMBwGA1UE
|
||||
AwwVcGhwLnRlc3RzLnN1Ym9yZGluYXRlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
|
||||
MIICCgKCAgEA4rmcz5M0B2Td+0g8+pmGT0IBCxZTVL14xKA1yLeY+6eshdNiRAIR
|
||||
8m5sI21AirtAh7mJziA2Q4C/1bRvY9VI/0yxXRP20aicNmhEvFVAvQCxmAkg8hIm
|
||||
WwDiNLw+4HpAkQInpd8exjExhvanUgAz6tq8w6CL2BqquiwQPVIf5HHMHjomz1gz
|
||||
iZEs6CRE5YMdUd7ZSx+MHl6ww3WYwW/XHDPzAUIe8uhOT+yA8lVLFAac3+lyjA6g
|
||||
zMPYG5SrqE6/+yZYDVx2WhVMjJq8d+N6hnIkhZeJyZo2T0G7/pSGIwaVsceIJ/8/
|
||||
6km8p4Dn2Pq75F8RZW5iz0MnSqKqSH/ANP71UuinpcVfnyg0ajy7J+cNMDC3gNPC
|
||||
L0b13qRhRsjNYdyOR7Aj5uQgCegDVipMGLIa+5Vxnzinc059/81QttbsrF2Ll96y
|
||||
lQk46zhyMOOTnVuX/6k2iFnNUNouXiFlEYPdxRAOJtcOL650F7wTtWolNAyEsRyH
|
||||
sv3wDXAFXp8b+B/Be1i1yfomP6VnXQMls6RR00qBtc8qEVAMddYihAv5MWa6vXSc
|
||||
+PA3dBJJBmBJeesqR2PC8kgs+CeGJfUS3VRcUmUKBWz+dMvHPSSiQebwg+Za3xz8
|
||||
l3WWPMVWwFUviyv8pw+AB30d5m/akB/r7a1f2FJjwg1P7atkZzz0/SUCAwEAATAN
|
||||
BgkqhkiG9w0BAQUFAAOCAgEATP38i4XRo2if8SZLqg/kdZQ/B7ER5PpOS0YkMgp+
|
||||
g1dLpUrjthIFJ96s9akxO4Bq1NUnt/Ms/8RgTHlM8xF3HuXBt6C6MjeIL9keg0rz
|
||||
D3dObstOGhqYrUpEhcCaG9mtWQ4G7n86e1/zKTIORAPBD1LPvp6nIzJGNU5DwPeR
|
||||
u+RK1/DCUBNk1YHrhxj6AevagVozTEeZ2F5AQK9B78MG1fXezN5q5ubLyJZG673q
|
||||
G1+rhigUrK2xoJzE+DDWlhrVt2nkdzK+rlP63Y9I/XUH76OT4kuLXqttnbWfuvCr
|
||||
mVt5st+nx24hGmd9yaiKPsUFPlbSfhwzstGreGlsdWIYKzCwnXX6niVMBdKwrRfa
|
||||
PBnmZbG3YYcMflWLcMUscCqvlPDn9fQS6uwKT6xcEDIou6a8KpQpEgo9k+KUpX2Z
|
||||
DpyFkDGEeYR2qENlblEoPpkBITWq68tY4jjkHETh1spgDisIzZFkFcupSIrcIaXb
|
||||
T05gv3POWqb8soejrxMBQHQwkHkZNHcaOBPTJMRG3UTkRbI/UN77oOjCk7/tWa0B
|
||||
GDEF2eMQ8bpTChQsr4pfIqaHjx4NVdLlZ4OfVoGlKISmMYjU+bVIYZibRNZg/GYP
|
||||
fUs9sB8ZSRTFvsOHtL5hoD/BYhPIQ5g2fkDsYdfQZIMPQidO+R9lOvMQUgPy/gGd
|
||||
JzA=
|
||||
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
|
||||
qYuYP+6Ymt/rUWXGVh0=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
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
|
||||
BSQ9sUZ6sNXnTkyYon6iH6WULvmSTgBGnQ==
|
||||
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
|
||||
-----END CERTIFICATE-----
|
||||
Loaded 100 of 184 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user