Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
316802d8f2 | ||
|
|
6c1c49d1b5 | ||
|
|
6e3356837d | ||
|
|
49501f8f41 | ||
|
|
3af6201224 | ||
|
|
6b77792dc2 | ||
|
|
05de40a651 | ||
|
|
6275825c68 | ||
|
|
4f8e703854 | ||
|
|
d8c80af71e | ||
|
|
9ec0a2071c | ||
|
|
e112d71435 | ||
|
|
2def85688d | ||
|
|
259477826c | ||
|
|
5dc847c53d | ||
|
|
1f3b87dc11 | ||
|
|
ab07265573 | ||
|
|
707b2a529e | ||
|
|
bd0b0cc8c9 | ||
|
|
71fd58652f | ||
|
|
df5104bfc9 | ||
|
|
112afb9250 | ||
|
|
2492add033 | ||
|
|
73d84d4bbd | ||
|
|
18f567a3b4 | ||
|
|
a80e462fbd | ||
|
|
cd6893aed1 | ||
|
|
d6406bbf5f | ||
|
|
2fab62271a | ||
|
|
6445b3a68f | ||
|
|
1135161b4f | ||
|
|
4d936c1254 | ||
|
|
f555224743 | ||
|
|
0a2a136111 | ||
|
|
3069ad8dd1 | ||
|
|
36eddfc785 | ||
|
|
207105b1a3 | ||
|
|
f64be0b013 | ||
|
|
bbf39c550f | ||
|
|
de5a5f6fdc | ||
|
|
472b25921e | ||
|
|
b202587e09 | ||
|
|
a871badf2a | ||
|
|
4fb7665c09 | ||
|
|
1a23ebc1ff | ||
|
|
f877b86604 | ||
|
|
e88ab74886 | ||
|
|
b59718bdc4 | ||
|
|
aecf996510 | ||
|
|
e53dd027c5 | ||
|
|
f5b4cb7130 | ||
|
|
4375a6c5cd | ||
|
|
f7cf839213 | ||
|
|
e7dd9c781b | ||
|
|
46ecda76ba | ||
|
|
307acb6618 | ||
|
|
b06f8cb58b | ||
|
|
823ca5c697 | ||
|
|
42608a3401 | ||
|
|
afb20f4895 | ||
|
|
e62db6309c | ||
|
|
315d3910fa | ||
|
|
075986f214 | ||
|
|
ef0bd7b215 | ||
|
|
03314e3f69 | ||
|
|
596a892c5e | ||
|
|
a0d1e0915c | ||
|
|
631fc3c9c1 | ||
|
|
3140d40421 | ||
|
|
abd97b8bcb | ||
|
|
86aa1ca990 | ||
|
|
618dcd6520 | ||
|
|
f589e5c791 | ||
|
|
dcd669b4d9 | ||
|
|
9ebf813ea4 | ||
|
|
4c9fe5a490 | ||
|
|
d36344e888 | ||
|
|
da966a93ac | ||
|
|
d058e30917 | ||
|
|
41d7621f48 | ||
|
|
6b73b2d6eb | ||
|
|
aa0e402acf | ||
|
|
17bb8d575a | ||
|
|
bf1c242cf4 | ||
|
|
aee20e637a | ||
|
|
159e5c1048 | ||
|
|
353f7bf461 | ||
|
|
e53162a32b | ||
|
|
41e9ba6333 | ||
|
|
fb9bf5b64b | ||
|
|
a8a9e93e9a | ||
|
|
355743600d | ||
|
|
21c6ba3412 | ||
|
|
9689796c10 | ||
|
|
93c2c56a1b | ||
|
|
39f0e810c9 | ||
|
|
fbc8596b68 | ||
|
|
54e2224df7 | ||
|
|
3e5b8c1e89 | ||
|
|
9ba2cfd33e | ||
|
|
29e4d4eee6 | ||
|
|
aa925cb0ad | ||
|
|
4988e83fe9 | ||
|
|
c2b8066efb | ||
|
|
042ff13ca9 | ||
|
|
9871555090 | ||
|
|
9ca1b2a775 | ||
|
|
91240073ea | ||
|
|
63607375f5 | ||
|
|
2cc1cbf2f4 | ||
|
|
15abb2b56e | ||
|
|
e78712791d | ||
|
|
5097e2ee13 | ||
|
|
b4bce59fe9 | ||
|
|
1fdc518971 | ||
|
|
b112d09013 | ||
|
|
afdf7519d1 | ||
|
|
5e5895a464 | ||
|
|
5f030924c1 | ||
|
|
666cb6c802 | ||
|
|
6202c821a9 | ||
|
|
9c6262f39b | ||
|
|
b2934d2612 | ||
|
|
43e7656241 | ||
|
|
6278f6140f | ||
|
|
1b05a2373b | ||
|
|
fe107cce45 | ||
|
|
6c2c7a023d | ||
|
|
5069d52189 | ||
|
|
4f06b62781 | ||
|
|
f0d40286e7 | ||
|
|
cd06b5af09 | ||
|
|
0c0cbb43da | ||
|
|
64e6ddc7f7 | ||
|
|
ad5222c3a6 | ||
|
|
b8da481a2a | ||
|
|
d9d152b895 | ||
|
|
a8e25fdbf8 | ||
|
|
2164e3a0b8 | ||
|
|
ce1a0d971b | ||
|
|
5856becc2b | ||
|
|
9b87b73fec | ||
|
|
c62e5eb0a9 | ||
|
|
97ff7bbb36 | ||
|
|
03383119d2 | ||
|
|
eab66f9068 | ||
|
|
4db1e1adf2 | ||
|
|
2d6d1ec55b | ||
|
|
2d96fdd54f | ||
|
|
0c21187363 | ||
|
|
34df3cdafa | ||
|
|
650f68c36e | ||
|
|
d53b78c6ed | ||
|
|
74d7f1d04e | ||
|
|
3f45262aa9 | ||
|
|
85895b2e5b | ||
|
|
1d7e1f845f | ||
|
|
82e4ad3983 | ||
|
|
74a696d53b | ||
|
|
ae99959986 | ||
|
|
782f45c8e6 | ||
|
|
71e47c5c13 | ||
|
|
f213ee5952 | ||
|
|
4d6f808c16 | ||
|
|
613c8dd7b0 | ||
|
|
5d777e56e2 | ||
|
|
c48c638aeb | ||
|
|
e3d25e78eb | ||
|
|
80d839d25a | ||
|
|
2ae0dd7f61 | ||
|
|
55e7459cea | ||
|
|
b01336814d | ||
|
|
4a6ef8327a | ||
|
|
b62fb3aa0c | ||
|
|
34e5d3a87d | ||
|
|
262aeb8ae1 | ||
|
|
0ddda0dcb7 | ||
|
|
9fcfe52d03 | ||
|
|
afc2be8fc8 | ||
|
|
f894bb750c | ||
|
|
efb1be547c | ||
|
|
84a18c4782 | ||
|
|
e36c04ef48 | ||
|
|
08fef4cc23 | ||
|
|
80f4297c25 | ||
|
|
c7aa8ba0ee | ||
|
|
57c435e5ac | ||
|
|
2d8fe973b1 | ||
|
|
4cde48bb73 | ||
|
|
3f9e8e6686 | ||
|
|
3306b3aa60 | ||
|
|
9ff4801159 | ||
|
|
eaf5c7cdd4 | ||
|
|
bd00fe81cc | ||
|
|
d3060a00d1 | ||
|
|
bb9ea4e88b | ||
|
|
6b1fbafdf0 | ||
|
|
787ea0dda5 | ||
|
|
664eca5967 | ||
|
|
747f5b23ae | ||
|
|
46a6ae0d45 | ||
|
|
de65a2243f | ||
|
|
53e59e4b34 | ||
|
|
0e61cddeb1 | ||
|
|
3df47c12f7 | ||
|
|
f469edcf59 | ||
|
|
4ddb0630c2 | ||
|
|
238f837cbc | ||
|
|
3fd7d819b8 | ||
|
|
8d5a5fbf6b | ||
|
|
78ad5e8864 | ||
|
|
69b48f83df | ||
|
|
2e8759428b | ||
|
|
dbc2ffba82 | ||
|
|
66729aeeeb | ||
|
|
7453d2303b | ||
|
|
bedd881da6 | ||
|
|
cdf9178c43 | ||
|
|
f901e7e3c5 | ||
|
|
515b396889 | ||
|
|
b44484b912 | ||
|
|
924ff6164e | ||
|
|
0489e85c18 | ||
|
|
cb7e42da25 | ||
|
|
2dc81d4a09 | ||
|
|
a769d873f8 | ||
|
|
660b829ccc | ||
|
|
e2b61eccb9 | ||
|
|
6918a68d9d | ||
|
|
b7eb2c0604 | ||
|
|
0ec147d301 | ||
|
|
8a6afbef3f | ||
|
|
742895f60c | ||
|
|
52964bbfb2 | ||
|
|
5816ce330c | ||
|
|
23c124ec75 | ||
|
|
f1d7857969 | ||
|
|
94e6c72e26 | ||
|
|
642fb44d69 | ||
|
|
c4e11c8ef3 | ||
|
|
a6e4a713ea | ||
|
|
706f0cf8a0 | ||
|
|
24cfbfd56f | ||
|
|
077e61fad3 | ||
|
|
c0bcd301d3 | ||
|
|
0e4af9192f | ||
|
|
88f752a947 | ||
|
|
f116a88592 | ||
|
|
418da85f15 | ||
|
|
9af5b7f33d | ||
|
|
47334646db | ||
|
|
089f4ff885 | ||
|
|
a4e3589966 | ||
|
|
775b4b54d8 | ||
|
|
e23c132940 | ||
|
|
1229b0f8cb | ||
|
|
c562d44321 | ||
|
|
401188cbf9 | ||
|
|
c499bd12f7 | ||
|
|
8a2e747a7b | ||
|
|
4672411ef5 | ||
|
|
96665fbfe0 | ||
|
|
1e9ad4a307 | ||
|
|
3fc52f1dc4 | ||
|
|
c068818ff3 | ||
|
|
e0c0007bd2 | ||
|
|
ad12da4908 | ||
|
|
76ce874422 | ||
|
|
134e713be2 | ||
|
|
bad5d0d6c5 | ||
|
|
14e8f9557b | ||
|
|
4cb1151fff | ||
|
|
e405ff59f9 | ||
|
|
3fa76ac54f | ||
|
|
69ec51eb02 | ||
|
|
7ec8b8d49f | ||
|
|
f8ffc9622b | ||
|
|
0e2a7fc829 | ||
|
|
557029e8e6 | ||
|
|
d8a14e2aad | ||
|
|
735b34c016 | ||
|
|
01090e6ced | ||
|
|
a8f98fc7f7 | ||
|
|
08177312fb | ||
|
|
256ec5bebb | ||
|
|
3a7b0027f3 | ||
|
|
96ad72dc29 | ||
|
|
4b3ed311aa | ||
|
|
9b3c26d4f4 | ||
|
|
6242230219 | ||
|
|
463413db53 | ||
|
|
e2b240c164 | ||
|
|
84926a0d71 | ||
|
|
95d2908814 | ||
|
|
0b2c456312 | ||
|
|
1b9d0c8af3 | ||
|
|
b8eb110cd5 | ||
|
|
fa33b065ac | ||
|
|
ce06677069 | ||
|
|
2ec3c67428 | ||
|
|
7c21535fb3 | ||
|
|
ecad9a470f | ||
|
|
9b9184a45a | ||
|
|
18595b6fc6 | ||
|
|
8ef5a50e2d | ||
|
|
f67a3cc9bd | ||
|
|
bb02f99e71 | ||
|
|
a9e8239f45 | ||
|
|
c9fd093127 | ||
|
|
d25049cc1b | ||
|
|
2b36f3d71f | ||
|
|
2cca43b3ab | ||
|
|
6fcc7134f1 | ||
|
|
112eda7525 | ||
|
|
3185f8628f | ||
|
|
95a1f77b5e | ||
|
|
4252f14299 | ||
|
|
e5beb4e828 | ||
|
|
8447b86eef | ||
|
|
5274cefb4d | ||
|
|
ecb67e59d7 | ||
|
|
5b12b46a19 | ||
|
|
a624ded4d3 | ||
|
|
8e7c99acf4 | ||
|
|
afc22828ea | ||
|
|
f9d6cff67e | ||
|
|
4e9158da76 | ||
|
|
51cdd3dc50 | ||
|
|
9cd82df0bb | ||
|
|
6c32d271d2 | ||
|
|
0903f6bffb | ||
|
|
582882ae18 | ||
|
|
c41d2535b1 | ||
|
|
f4323248ec | ||
|
|
b01448f9a6 |
No files matched your search
@@ -24,7 +24,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.7
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.9
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
@@ -93,12 +93,12 @@ User Functions/Methods Naming Conventions
|
||||
readability of the function name itself::
|
||||
|
||||
Good:
|
||||
'mcrypt_enc_self_test'
|
||||
'mysql_list_fields'
|
||||
'str_word_count'
|
||||
'array_key_exists'
|
||||
|
||||
Ok:
|
||||
'mcrypt_module_get_algo_supported_key_sizes'
|
||||
(could be 'mcrypt_mod_get_algo_sup_key_sizes'?)
|
||||
'date_interval_create_from_date_string'
|
||||
(could be 'date_intvl_create_from_date_str'?)
|
||||
'get_html_translation_table'
|
||||
(could be 'html_get_trans_table'?)
|
||||
|
||||
|
||||
@@ -1,5 +1,112 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
17 Aug 2017, PHP 7.2.0beta3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
|
||||
|
||||
- FTP:
|
||||
. Added ftp_append() function. (blar)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- SQLite3:
|
||||
. Updated to SQLite 3.20.0. (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #75049 (spl_autoload_unregister can't handle
|
||||
spl_autoload_functions results). (Laruence)
|
||||
. Added spl_object_id(). (Tyson Andre)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
|
||||
. Fixed bug #74103 (heap-use-after-free when unserializing invalid array
|
||||
size). (Nikita)
|
||||
. Fixed bug #75054 (A Denial of Service Vulnerability was found when
|
||||
performing deserialization). (Nikita)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
|
||||
properties). (blar)
|
||||
|
||||
03 Aug 2017, PHP 7.2.0beta2
|
||||
|
||||
- Core:
|
||||
. Implemented FR #74963 (Improved error message on fetching property of
|
||||
non-object). (Laruence)
|
||||
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
|
||||
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #74979 (Interactive shell opening instead of script execution
|
||||
with -f flag). (Anatol)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
|
||||
(cebe)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #69267 (mb_strtolower fails on titlecase characters). (Nikita)
|
||||
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
|
||||
(cmb)
|
||||
. Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
|
||||
(Nikita)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
|
||||
an abstract class). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Expose oci_unregister_taf_callback() (Tianfang Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74980 (Narrowing occurred during type inference). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74903 (openssl_pkcs7_encrypt() uses different EOL than before).
|
||||
(Anatol)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
|
||||
(bwbroersma)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
. Fixed bug #74936 (session_cache_expire/cache_limiter/save_path() trigger a
|
||||
warning in read mode). (morozov)
|
||||
. Fixed bug #74941 (session fails to start after having headers sent).
|
||||
(morozov)
|
||||
. Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
|
||||
(Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
|
||||
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
|
||||
(Andrew Nester)
|
||||
. Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74851 (uniqid() without more_entropy performs badly).
|
||||
(Emmanuel Dreyfus)
|
||||
|
||||
20 Jul 2017, PHP 7.2.0beta1
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -25,7 +25,7 @@ PHP 7.2 UPGRADE NOTES
|
||||
. is_object() will now return true for objects of class
|
||||
__PHP_Incomplete_Class.
|
||||
. Support for Netware operating systems have been removed.
|
||||
. Casting arrays to objects (with (object) or settype()) will now covert
|
||||
. Casting arrays to objects (with (object) or settype()) will now convert
|
||||
integer keys to string property names. This fixes the behaviour of previous
|
||||
versions, where integer keys would become inaccessible properties with
|
||||
integer names.
|
||||
@@ -161,7 +161,7 @@ All the deprecated functionality listed in the following will be removed in
|
||||
PHP 8.0.
|
||||
|
||||
- Core:
|
||||
. The trace_errors ini directive has been deprecated.
|
||||
. The track_errors ini directive has been deprecated.
|
||||
. The __autoload() mechanism has been deprecated, use spl_autoload_register()
|
||||
instead.
|
||||
. The (unset) cast has been deprecated. This does not affect the unset($var)
|
||||
@@ -169,6 +169,8 @@ PHP 8.0.
|
||||
. The create_function() function has been deprecated, use anonymous functions
|
||||
instead.
|
||||
. The each() function has been deprecated, use a foreach loop instead.
|
||||
. The $errcontext error handler argument has been deprecated. However, using
|
||||
it does not trigger a deprecation warning for technical reasons.
|
||||
|
||||
- EXIF:
|
||||
. The read_exif_data() alias have been deprecated, use exif_read_data() instead.
|
||||
@@ -233,6 +235,9 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
|
||||
. DomNodeList implements Countable, added DomNodeList::count().
|
||||
. DOMNamedNodeMap implements Countable, added DOMNamedNodeMap::count().
|
||||
|
||||
- FTP:
|
||||
. Added ftp_append().
|
||||
|
||||
- GD:
|
||||
. Added imagesetclip() and imagegetclip().
|
||||
. Added imageopenpolygon().
|
||||
|
||||
@@ -37,15 +37,15 @@ NULL
|
||||
Notice: Undefined variable: b in %s on line %d
|
||||
int(1)
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: c in %s on line %d
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property '1' of non-object in %s on line %d
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property '' of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -18,7 +18,7 @@ print "ok\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'a' of non-object in %s on line %d
|
||||
ok
|
||||
|
||||
Warning: Creating default object from empty value in %s on line %d
|
||||
|
||||
@@ -24,7 +24,7 @@ Notice: Undefined variable: arr in %s on line %d
|
||||
|
||||
Notice: Undefined variable: arr in %s on line %d
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'foo' of non-object in %s on line %d
|
||||
|
||||
Warning: Creating default object from empty value in %s on line %d
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ NULL
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
Warning: Attempt to assign property 'foo' of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
Warning: Attempt to assign property 'foo' of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -44,7 +44,7 @@ ok
|
||||
ok
|
||||
ok
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'wrong' of non-object in %s on line %d
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
@@ -52,4 +52,4 @@ ok
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
ok
|
||||
ok
|
||||
@@ -8,7 +8,7 @@ foreach($x->a->b as &$v) {
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property of non-object in %sbug36303.php on line 3
|
||||
Warning: Attempt to modify property 'a' of non-object in %sbug36303.php on line 3
|
||||
|
||||
Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3
|
||||
ok
|
||||
@@ -28,22 +28,22 @@ var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
--> read access:
|
||||
Notice: Trying to get property of non-object in %sbug44660.php on line 6
|
||||
Notice: Trying to get property 'p' of non-object in %sbug44660.php on line 6
|
||||
|
||||
--> direct assignment:
|
||||
Warning: Attempt to assign property of non-object in %sbug44660.php on line 9
|
||||
Warning: Attempt to assign property 'p' of non-object in %sbug44660.php on line 9
|
||||
|
||||
--> increment:
|
||||
Warning: Attempt to increment/decrement property of non-object in %sbug44660.php on line 12
|
||||
Warning: Attempt to increment/decrement property 'p' of non-object in %sbug44660.php on line 12
|
||||
|
||||
--> reference assignment:
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 15
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 15
|
||||
|
||||
--> reference assignment:
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 18
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 18
|
||||
|
||||
--> indexed assignment:
|
||||
Warning: Attempt to modify property of non-object in %sbug44660.php on line 21
|
||||
Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 21
|
||||
|
||||
--> Confirm assignments have had no impact:
|
||||
bool(true)
|
||||
@@ -7,5 +7,5 @@ $a->{"a"."b"};
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: a in %sbug47109.php on line 2
|
||||
|
||||
Notice: Trying to get property of non-object in %sbug47109.php on line 2
|
||||
Notice: Trying to get property 'ab' of non-object in %sbug47109.php on line 2
|
||||
|
||||
@@ -8,5 +8,5 @@ var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: Attempt to modify property of non-object in %sbug52237.php on line 3
|
||||
Warning: Attempt to modify property 'info' of non-object in %sbug52237.php on line 3
|
||||
string(4) "test"
|
||||
@@ -11,7 +11,7 @@ echo "ok\n";
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
|
||||
Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
|
||||
Warning: Attempt to modify property 'a' of non-object in %sbug54262.php on line 4
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
|
||||
ok
|
||||
@@ -11,7 +11,7 @@ var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
|
||||
Warning: Attempt to modify property 'b' of non-object in %sbug72911.php on line %d
|
||||
|
||||
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
|
||||
Warning: Attempt to assign property 'i' of non-object in %sbug72911.php on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #74947 (Segfault in scanner on INF number)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
INF-INF
|
||||
@@ -27,8 +27,8 @@ var_dump($h);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'a' of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'b' of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Bug #74954 (crash after update of generator yielding from finished generator)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from() {
|
||||
yield 1;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function gen($gen) {
|
||||
try {
|
||||
var_dump(yield from $gen);
|
||||
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
|
||||
}
|
||||
|
||||
$gen = from();
|
||||
$gens[] = gen($gen);
|
||||
$gens[] = gen($gen);
|
||||
|
||||
foreach ($gens as $g) {
|
||||
$g->current();
|
||||
}
|
||||
|
||||
do {
|
||||
foreach ($gens as $i => $g) {
|
||||
$g->next();
|
||||
}
|
||||
} while($gens[0]->valid());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Caught exception!
|
||||
Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): from()
|
||||
#1 [internal function]: gen(Object(Generator))
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->next()
|
||||
#2 {main}
|
||||
@@ -33,7 +33,7 @@ Notice: Undefined variable: c in %s on line %d
|
||||
|
||||
Notice: Undefined variable: d in %s on line %d
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property '' of non-object in %s on line %d
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Attempt to free invalid structure (result of ROPE_INIT is not a zval)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function () {
|
||||
throw new Exception();
|
||||
});
|
||||
$a = [];
|
||||
$b = "";
|
||||
try {
|
||||
echo "$a$b\n";
|
||||
} catch (Exception $ex) {
|
||||
}
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Live ranges should be ordered according to "start" position
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function($no, $msg) { throw new Exception; });
|
||||
|
||||
try {
|
||||
$a = [];
|
||||
$str = "$a${"y$a$a"}y";
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
|
||||
@@ -7,4 +7,4 @@ Cannot take property of a string
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'bar' of non-object in %s on line %d
|
||||
@@ -717,6 +717,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
extern zend_php_scanner_globals language_scanner_globals;
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_cp_set_by_id(65001);
|
||||
#endif
|
||||
|
||||
start_memory_manager();
|
||||
|
||||
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
|
||||
@@ -769,7 +773,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
#endif /* HAVE_SYS_SDT_H */
|
||||
#endif /* HAVE_DTRACE */
|
||||
zend_compile_string = compile_string;
|
||||
zend_throw_exception_hook = NULL;
|
||||
|
||||
|
||||
@@ -7844,7 +7844,7 @@ static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */
|
||||
GET_NODE(result, opline->result);
|
||||
} else {
|
||||
uint32_t var;
|
||||
uint32_t range = zend_start_live_range(CG(active_op_array), rope_init_lineno);
|
||||
uint32_t range = zend_start_live_range_ex(CG(active_op_array), rope_init_lineno);
|
||||
|
||||
init_opline->extended_value = j;
|
||||
opline->opcode = ZEND_ROPE_END;
|
||||
|
||||
@@ -1886,7 +1886,9 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
||||
object_init(container);
|
||||
} else {
|
||||
if (container_op_type != IS_VAR || EXPECTED(!Z_ISERROR_P(container))) {
|
||||
zend_error(E_WARNING, "Attempt to modify property of non-object");
|
||||
zend_string *property_name = zval_get_string(prop_ptr);
|
||||
zend_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
}
|
||||
ZVAL_ERROR(result);
|
||||
return;
|
||||
|
||||
@@ -753,15 +753,13 @@ failure:
|
||||
|
||||
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
|
||||
{
|
||||
zend_generator *generator;
|
||||
zend_generator *generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
/* The generator is already closed, thus can't resume */
|
||||
if (UNEXPECTED(!orig_generator->execute_data)) {
|
||||
if (UNEXPECTED(!generator->execute_data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
try_again:
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
zend_throw_error(NULL, "Cannot resume an already running generator");
|
||||
|
||||
@@ -1663,7 +1663,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (errno == ERANGE) { /* Overflow */
|
||||
errno = 0;
|
||||
if (yytext[0] == '0') { /* octal overflow */
|
||||
errno = 0;
|
||||
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, (const char **)&end));
|
||||
} else {
|
||||
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, (const char **)&end));
|
||||
@@ -1675,7 +1674,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
ZVAL_UNDEF(zendlval);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
ZEND_ASSERT(!errno);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
/* Also not an assert for the same reason */
|
||||
|
||||
@@ -476,7 +476,7 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str))
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
((n) ? (((n)<0) ? -1 : 1) : 0)
|
||||
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
|
||||
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ typedef unsigned long int uint32_t;
|
||||
#define NO_INFNAN_CHECK
|
||||
#endif
|
||||
|
||||
#ifndef NO_ERRNO
|
||||
#define NO_ERRNO
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define IEEE_BIG_ENDIAN 1
|
||||
#else
|
||||
|
||||
@@ -389,16 +389,21 @@ static void cwd_globals_dtor(virtual_cwd_globals *cwd_g) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
if (reinit) {
|
||||
free(main_cwd_state.cwd);
|
||||
}
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = php_win32_ioutil_getcwd(cwd, sizeof(cwd));
|
||||
#else
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
|
||||
if (!result) {
|
||||
cwd[0] = '\0';
|
||||
@@ -411,7 +416,12 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
}
|
||||
#endif
|
||||
main_cwd_state.cwd = strdup(cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
{
|
||||
virtual_cwd_main_cwd_init(0);
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
|
||||
#else
|
||||
|
||||
@@ -238,6 +238,10 @@ CWD_API zend_long realpath_cache_size(void);
|
||||
CWD_API zend_long realpath_cache_max_buckets(void);
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
|
||||
|
||||
#ifdef CWD_EXPORTS
|
||||
extern void virtual_cwd_main_cwd_init(uint8_t);
|
||||
#endif
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
|
||||
@@ -811,7 +811,9 @@ ZEND_VM_HELPER(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV,
|
||||
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
ZVAL_DEREF(object);
|
||||
if (UNEXPECTED(!make_real_object(object))) {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
zend_string *property_name = zval_get_string(property);
|
||||
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
}
|
||||
@@ -1070,7 +1072,9 @@ ZEND_VM_HELPER(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV,
|
||||
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
ZVAL_DEREF(object);
|
||||
if (UNEXPECTED(!make_real_object(object))) {
|
||||
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
|
||||
zend_string *property_name = zval_get_string(property);
|
||||
zend_error(E_WARNING, "Attempt to increment/decrement property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
}
|
||||
@@ -1147,7 +1151,9 @@ ZEND_VM_HELPER(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV,
|
||||
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
ZVAL_DEREF(object);
|
||||
if (UNEXPECTED(!make_real_object(object))) {
|
||||
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
|
||||
zend_string *property_name = zval_get_string(property);
|
||||
zend_error(E_WARNING, "Attempt to increment/decrement property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
break;
|
||||
}
|
||||
@@ -1802,8 +1808,11 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR
|
||||
}
|
||||
|
||||
if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
|
||||
zend_string *property_name;
|
||||
ZEND_VM_C_LABEL(fetch_obj_r_no_object):
|
||||
zend_error(E_NOTICE, "Trying to get property of non-object");
|
||||
property_name = zval_get_string(offset);
|
||||
zend_error(E_NOTICE, "Trying to get property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
} else {
|
||||
retval = zobj->handlers->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
|
||||
@@ -2014,7 +2023,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2, free_op_data;
|
||||
zval *object, *property_name, *value, tmp;
|
||||
zval *object, *property, *value, tmp;
|
||||
|
||||
SAVE_OPLINE();
|
||||
object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
|
||||
@@ -2023,7 +2032,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_this_not_in_object_context_helper);
|
||||
}
|
||||
|
||||
property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
|
||||
@@ -2055,7 +2064,9 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
|
||||
Z_DELREF_P(object);
|
||||
} else {
|
||||
if (OP1_TYPE != IS_VAR || EXPECTED(!Z_ISERROR_P(object))) {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
zend_string *property_name = zval_get_string(property);
|
||||
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
}
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
@@ -2067,16 +2078,16 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
|
||||
}
|
||||
|
||||
if (OP2_TYPE == IS_CONST &&
|
||||
EXPECTED(Z_OBJCE_P(object) == CACHED_PTR(Z_CACHE_SLOT_P(property_name)))) {
|
||||
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(property_name) + sizeof(void*));
|
||||
EXPECTED(Z_OBJCE_P(object) == CACHED_PTR(Z_CACHE_SLOT_P(property)))) {
|
||||
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(property) + sizeof(void*));
|
||||
zend_object *zobj = Z_OBJ_P(object);
|
||||
zval *property;
|
||||
zval *property_val;
|
||||
|
||||
if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
|
||||
property = OBJ_PROP(zobj, prop_offset);
|
||||
if (Z_TYPE_P(property) != IS_UNDEF) {
|
||||
property_val = OBJ_PROP(zobj, prop_offset);
|
||||
if (Z_TYPE_P(property_val) != IS_UNDEF) {
|
||||
ZEND_VM_C_LABEL(fast_assign_obj):
|
||||
value = zend_assign_to_variable(property, value, OP_DATA_TYPE);
|
||||
value = zend_assign_to_variable(property_val, value, OP_DATA_TYPE);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), value);
|
||||
}
|
||||
@@ -2090,8 +2101,8 @@ ZEND_VM_C_LABEL(fast_assign_obj):
|
||||
}
|
||||
zobj->properties = zend_array_dup(zobj->properties);
|
||||
}
|
||||
property = zend_hash_find(zobj->properties, Z_STR_P(property_name));
|
||||
if (property) {
|
||||
property_val = zend_hash_find(zobj->properties, Z_STR_P(property));
|
||||
if (property_val) {
|
||||
ZEND_VM_C_GOTO(fast_assign_obj);
|
||||
}
|
||||
}
|
||||
@@ -2129,7 +2140,7 @@ ZEND_VM_C_LABEL(fast_assign_obj):
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
}
|
||||
zend_hash_add_new(zobj->properties, Z_STR_P(property_name), value);
|
||||
zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), value);
|
||||
}
|
||||
@@ -2139,7 +2150,9 @@ ZEND_VM_C_LABEL(fast_assign_obj):
|
||||
}
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->write_property) {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
zend_string *property_name = zval_get_string(property);
|
||||
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
}
|
||||
@@ -2151,7 +2164,7 @@ ZEND_VM_C_LABEL(fast_assign_obj):
|
||||
ZVAL_DEREF(value);
|
||||
}
|
||||
|
||||
Z_OBJ_HT_P(object)->write_property(object, property_name, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL);
|
||||
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_COPY(EX_VAR(opline->result.var), value);
|
||||
@@ -2667,8 +2680,51 @@ ZEND_VM_HANDLER(53, ZEND_FAST_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
|
||||
zval *op1, *op2;
|
||||
zend_string *op1_str, *op2_str, *str;
|
||||
|
||||
SAVE_OPLINE();
|
||||
|
||||
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
if ((OP1_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
|
||||
(OP2_TYPE == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
|
||||
zend_string *op1_str = Z_STR_P(op1);
|
||||
zend_string *op2_str = Z_STR_P(op2);
|
||||
zend_string *str;
|
||||
|
||||
do {
|
||||
if (OP1_TYPE != IS_CONST) {
|
||||
if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) {
|
||||
ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str);
|
||||
FREE_OP1();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (OP2_TYPE != IS_CONST) {
|
||||
if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) {
|
||||
ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str);
|
||||
FREE_OP1();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_CV &&
|
||||
!ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
|
||||
size_t len = ZSTR_LEN(op1_str);
|
||||
|
||||
str = zend_string_extend(op1_str, len + ZSTR_LEN(op2_str), 0);
|
||||
memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
|
||||
ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
|
||||
break;
|
||||
} else {
|
||||
str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0);
|
||||
memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str));
|
||||
memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
|
||||
ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
|
||||
}
|
||||
FREE_OP1();
|
||||
} while (0);
|
||||
FREE_OP2();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
SAVE_OPLINE();
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
op1_str = Z_STR_P(op1);
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
|
||||
@@ -2679,7 +2735,6 @@ ZEND_VM_HANDLER(53, ZEND_FAST_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
|
||||
}
|
||||
op1_str = _zval_get_string_func(op1);
|
||||
}
|
||||
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
|
||||
if (OP2_TYPE == IS_CONST) {
|
||||
op2_str = Z_STR_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
|
||||
@@ -5555,7 +5610,9 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV)
|
||||
if (Z_OBJ_HT_P(container)->unset_property) {
|
||||
Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL));
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Trying to unset property of non-object");
|
||||
zend_string *property_name = zval_get_string(offset);
|
||||
zend_error(E_NOTICE, "Trying to unset property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
@@ -6447,7 +6504,9 @@ ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED|THIS|CV, C
|
||||
}
|
||||
}
|
||||
if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) {
|
||||
zend_error(E_NOTICE, "Trying to check property of non-object");
|
||||
zend_string *property_name = zval_get_string(offset);
|
||||
zend_error(E_NOTICE, "Trying to check property '%s' of non-object", ZSTR_VAL(property_name));
|
||||
zend_string_release(property_name);
|
||||
ZEND_VM_C_LABEL(isset_no_object):
|
||||
result = ((opline->extended_value & ZEND_ISSET) == 0);
|
||||
} else {
|
||||
@@ -7021,6 +7080,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) {
|
||||
switch (throw_op->opcode) {
|
||||
case ZEND_ADD_ARRAY_ELEMENT:
|
||||
case ZEND_ROPE_INIT:
|
||||
case ZEND_ROPE_ADD:
|
||||
break; /* exception while building structures, live range handling will free those */
|
||||
|
||||
@@ -8050,13 +8110,13 @@ ZEND_VM_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM)
|
||||
result = zend_hash_exists(ht, ZSTR_EMPTY_ALLOC());
|
||||
} else {
|
||||
zend_string *key;
|
||||
zval tmp;
|
||||
zval key_tmp, result_tmp;
|
||||
|
||||
result = 0;
|
||||
ZEND_HASH_FOREACH_STR_KEY(ht, key) {
|
||||
ZVAL_STR(&tmp, key);
|
||||
compare_function(&tmp, op1, &tmp);
|
||||
if (Z_LVAL(tmp) == 0) {
|
||||
ZVAL_STR(&key_tmp, key);
|
||||
compare_function(&result_tmp, op1, &key_tmp);
|
||||
if (Z_LVAL(result_tmp) == 0) {
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
|
||||
|
||||
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_EXTRA_VERSION="beta3"
|
||||
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`
|
||||
|
||||
|
||||
@@ -17,11 +17,23 @@ if test "$PHP_CURL" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
if which dpkg-architecture>/dev/null; then
|
||||
AC_MSG_CHECKING(for cURL in multiarch path)
|
||||
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
|
||||
CURL_DIR=/usr
|
||||
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the libcurl distribution -
|
||||
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
fi
|
||||
|
||||
@@ -45,7 +57,11 @@ if test "$PHP_CURL" != "no"; then
|
||||
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
if test -z "$CURL_MULTIARCH_INCLUDE"; then
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
else
|
||||
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
|
||||
fi
|
||||
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
||||
|
||||
|
||||
@@ -1962,6 +1962,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
|
||||
if (iterator->object->current) {
|
||||
timelib_time_dtor(iterator->object->current);
|
||||
}
|
||||
if (!iterator->object->start) {
|
||||
zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
|
||||
return;
|
||||
}
|
||||
iterator->object->current = timelib_time_clone(iterator->object->start);
|
||||
date_period_it_invalidate_current(iter);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #75002 Null Pointer Dereference in timelib_time_clone
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class aaa extends DatePeriod {
|
||||
public function __construct() { }
|
||||
}
|
||||
|
||||
$start=new DateTime( '2012-08-01' );
|
||||
|
||||
foreach (new aaa($start) as $y) {
|
||||
$a=$key;
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: DatePeriod has not been initialized correctly in %sbug75002.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug75002.php on line %d
|
||||
@@ -56,7 +56,7 @@ bool(false)
|
||||
testing property access
|
||||
string(4) "data"
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'textContent' of non-object in %s on line %d
|
||||
NULL
|
||||
testing offset not a long
|
||||
array(1) {
|
||||
@@ -64,7 +64,7 @@ array(1) {
|
||||
string(4) "test"
|
||||
}
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property 'textContent' of non-object in %s on line %d
|
||||
bool(false)
|
||||
NULL
|
||||
array(1) {
|
||||
|
||||
@@ -1973,11 +1973,11 @@ static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_ty
|
||||
char *buf;
|
||||
|
||||
spprintf(&buf, 0, "%s(%d): %s", _file, _line, format);
|
||||
php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args);
|
||||
php_verror(docref, ImageInfo && ImageInfo->FileName ? ImageInfo->FileName:"", type, buf, args);
|
||||
efree(buf);
|
||||
}
|
||||
#else
|
||||
php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args);
|
||||
php_verror(docref, ImageInfo && ImageInfo->FileName ? ImageInfo->FileName:"", type, format, args);
|
||||
#endif
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 860 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 917 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 18 KiB |
@@ -12,5 +12,5 @@ var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
int(86)
|
||||
int(84)
|
||||
Done
|
||||
|
Before Width: | Height: | Size: 504 KiB After Width: | Height: | Size: 15 KiB |
@@ -12,5 +12,5 @@ var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
int(76)
|
||||
int(72)
|
||||
Done
|
||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 4.7 MiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -7,7 +7,7 @@ output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug73115.JPG';
|
||||
$infile = dirname(__FILE__).'/bug73115.jpg';
|
||||
var_dump(count(exif_read_data($infile)));
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Test exif_read_data on unavailable file
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug73115.JPG';
|
||||
exif_read_data($infile);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(): Unable to open file in %sexif_read_data_0.php on line %d
|
||||
===DONE===
|
||||
|
||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 35 KiB |
@@ -1,16 +1,38 @@
|
||||
--TEST--
|
||||
Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
|
||||
if (ini_get("default_charset") != "UTF-8") {
|
||||
die("skip require default_charset == UTF-8");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647私はガラスを食べられます.mov";
|
||||
$src = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647.mov";
|
||||
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
|
||||
/* Streams mb path support is tested a lot elsewhere. Copy the existing file
|
||||
therefore, avoid duplication in the repo. */
|
||||
if (!copy($src, $f) || empty(glob($f))) {
|
||||
die("failed to copy '$src' to '$f'");
|
||||
}
|
||||
|
||||
$fi = new finfo(FILEINFO_MIME_TYPE);
|
||||
var_dump($fi->file($f));
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--CLEAN--
|
||||
<?php
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
unlink($f);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(15) "video/quicktime"
|
||||
+++DONE+++
|
||||
|
||||
@@ -1056,6 +1056,74 @@ bail:
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ ftp_append
|
||||
*/
|
||||
int
|
||||
ftp_append(ftpbuf_t *ftp, const char *path, const size_t path_len, php_stream *instream, ftptype_t type)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
zend_long size;
|
||||
char *ptr;
|
||||
int ch;
|
||||
|
||||
if (ftp == NULL) {
|
||||
return 0;
|
||||
}
|
||||
if (!ftp_type(ftp, type)) {
|
||||
goto bail;
|
||||
}
|
||||
if ((data = ftp_getdata(ftp)) == NULL) {
|
||||
goto bail;
|
||||
}
|
||||
ftp->data = data;
|
||||
|
||||
if (!ftp_putcmd(ftp, "APPE", sizeof("APPE")-1, path, path_len)) {
|
||||
goto bail;
|
||||
}
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
|
||||
goto bail;
|
||||
}
|
||||
if ((data = data_accept(data, ftp)) == NULL) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
size = 0;
|
||||
ptr = data->buf;
|
||||
while (!php_stream_eof(instream) && (ch = php_stream_getc(instream))!=EOF) {
|
||||
/* flush if necessary */
|
||||
if (FTP_BUFSIZE - size < 2) {
|
||||
if (my_send(ftp, data->fd, data->buf, size) != size) {
|
||||
goto bail;
|
||||
}
|
||||
ptr = data->buf;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
if (ch == '\n' && type == FTPTYPE_ASCII) {
|
||||
*ptr++ = '\r';
|
||||
size++;
|
||||
}
|
||||
|
||||
*ptr++ = ch;
|
||||
size++;
|
||||
}
|
||||
|
||||
if (size && my_send(ftp, data->fd, data->buf, size) != size) {
|
||||
goto bail;
|
||||
}
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250 && ftp->resp != 200)) {
|
||||
goto bail;
|
||||
}
|
||||
return 1;
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ ftp_size
|
||||
*/
|
||||
zend_long
|
||||
|
||||
@@ -190,6 +190,11 @@ int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, const size_
|
||||
*/
|
||||
int ftp_put(ftpbuf_t *ftp, const char *path, const size_t path_len, php_stream *instream, ftptype_t type, zend_long startpos);
|
||||
|
||||
/* append the data from a file, socket, or process as a file on the remote server
|
||||
* returns true on success, false on error
|
||||
*/
|
||||
int ftp_append(ftpbuf_t *ftp, const char *path, const size_t path_len, php_stream *instream, ftptype_t type);
|
||||
|
||||
/* returns the size of the given file, or -1 on error */
|
||||
zend_long ftp_size(ftpbuf_t *ftp, const char *path, const size_t path_len);
|
||||
|
||||
|
||||
@@ -191,6 +191,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_put, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, startpos)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_append, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, ftp)
|
||||
ZEND_ARG_INFO(0, remote_file)
|
||||
ZEND_ARG_INFO(0, local_file)
|
||||
ZEND_ARG_INFO(0, mode)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_put, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, ftp)
|
||||
ZEND_ARG_INFO(0, remote_file)
|
||||
@@ -265,6 +272,7 @@ const zend_function_entry php_ftp_functions[] = {
|
||||
PHP_FE(ftp_get, arginfo_ftp_get)
|
||||
PHP_FE(ftp_fget, arginfo_ftp_fget)
|
||||
PHP_FE(ftp_put, arginfo_ftp_put)
|
||||
PHP_FE(ftp_append, arginfo_ftp_append)
|
||||
PHP_FE(ftp_fput, arginfo_ftp_fput)
|
||||
PHP_FE(ftp_size, arginfo_ftp_size)
|
||||
PHP_FE(ftp_mdtm, arginfo_ftp_mdtm)
|
||||
@@ -1272,6 +1280,41 @@ PHP_FUNCTION(ftp_put)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool ftp_append(resource stream, string remote_file, string local_file, int mode)
|
||||
Append content of a file a another file on the FTP server */
|
||||
PHP_FUNCTION(ftp_append)
|
||||
{
|
||||
zval *z_ftp;
|
||||
ftpbuf_t *ftp;
|
||||
ftptype_t xtype;
|
||||
char *remote, *local;
|
||||
size_t remote_len, local_len;
|
||||
zend_long mode;
|
||||
php_stream *instream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl", &z_ftp, &remote, &remote_len, &local, &local_len, &mode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
XTYPE(xtype, mode);
|
||||
|
||||
if (!(instream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", REPORT_ERRORS, NULL))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!ftp_append(ftp, remote, remote_len, instream, xtype)) {
|
||||
php_stream_close(instream);
|
||||
php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
php_stream_close(instream);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int ftp_nb_put(resource stream, string remote_file, string local_file, int mode[, int startpos])
|
||||
Stores a file on the FTP server */
|
||||
|
||||
@@ -60,6 +60,7 @@ PHP_FUNCTION(ftp_pasv);
|
||||
PHP_FUNCTION(ftp_get);
|
||||
PHP_FUNCTION(ftp_fget);
|
||||
PHP_FUNCTION(ftp_put);
|
||||
PHP_FUNCTION(ftp_append);
|
||||
PHP_FUNCTION(ftp_fput);
|
||||
PHP_FUNCTION(ftp_size);
|
||||
PHP_FUNCTION(ftp_mdtm);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
ftp_append() create new file and append something
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require 'skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$ftp = ftp_connect('127.0.0.1', $port);
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
var_dump(ftp_login($ftp, 'user', 'pass'));
|
||||
|
||||
@unlink(__DIR__.'/ftp_append_foobar');
|
||||
|
||||
file_put_contents(__DIR__.'/ftp_append_foo', 'foo');
|
||||
var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_foo', FTP_BINARY));
|
||||
|
||||
file_put_contents(__DIR__.'/ftp_append_bar', 'bar');
|
||||
var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_bar', FTP_BINARY));
|
||||
|
||||
var_dump(file_get_contents(__DIR__.'/ftp_append_foobar'));
|
||||
|
||||
ftp_close($ftp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
string(6) "foobar"
|
||||
@@ -267,7 +267,28 @@ if ($pid) {
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
|
||||
} elseif (preg_match("~^APPE ([\w/.-]+)\r\n$~", $buf, $m)) {
|
||||
fputs($s, "150 File status okay; about to open data connection\r\n");
|
||||
|
||||
if(empty($pasv))
|
||||
{
|
||||
if (!$fs = stream_socket_client("tcp://$host:$port")) {
|
||||
fputs($s, "425 Can't open data connection\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = stream_get_contents($fs);
|
||||
file_put_contents(__DIR__.'/'.$m[1], $data, FILE_APPEND);
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
fclose($fs);
|
||||
}else{
|
||||
$data = stream_get_contents($fs);
|
||||
file_put_contents(__DIR__.'/'.$m[1], $data, FILE_APPEND);
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
fclose($fs);
|
||||
}
|
||||
|
||||
}elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
|
||||
change_dir($m[1]);
|
||||
fputs($s, "250 CWD command successful.\r\n");
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -1,5 +1,9 @@
|
||||
--TEST--
|
||||
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
imagegetclip() - basic functionality
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd required');
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
imagesetclip() - basic functionality
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd required');
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
imagetypes() - BMP support
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd required');
|
||||
?>
|
||||
|
||||
@@ -597,6 +597,22 @@ PHP_FUNCTION(hash_algos)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array hash_hmac_algos(void)
|
||||
Return a list of registered hashing algorithms suitable for hash_hmac() */
|
||||
PHP_FUNCTION(hash_hmac_algos)
|
||||
{
|
||||
zend_string *str;
|
||||
const php_hash_ops *ops;
|
||||
|
||||
array_init(return_value);
|
||||
ZEND_HASH_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) {
|
||||
if (ops->is_crypto) {
|
||||
add_next_index_str(return_value, zend_string_copy(str));
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string hash_hkdf(string algo, string ikm [, int length = 0, string info = '', string salt = ''])
|
||||
RFC5869 HMAC-based key derivation function */
|
||||
PHP_FUNCTION(hash_hkdf)
|
||||
@@ -1429,6 +1445,7 @@ const zend_function_entry hash_functions[] = {
|
||||
PHP_FE(hash_copy, arginfo_hash_copy)
|
||||
|
||||
PHP_FE(hash_algos, arginfo_hash_algos)
|
||||
PHP_FE(hash_hmac_algos, arginfo_hash_algos)
|
||||
PHP_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
|
||||
PHP_FE(hash_equals, arginfo_hash_equals)
|
||||
PHP_FE(hash_hkdf, arginfo_hash_hkdf)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
Test hash_hmac_algos() function : basic functionality
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
print_r(hash_hmac_algos());
|
||||
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[%d] => md2
|
||||
[%d] => md4
|
||||
[%d] => md5
|
||||
[%d] => sha1
|
||||
[%d] => sha224
|
||||
[%d] => sha256
|
||||
[%d] => sha384
|
||||
[%d] => sha512/224
|
||||
[%d] => sha512/256
|
||||
[%d] => sha512
|
||||
[%d] => sha3-224
|
||||
[%d] => sha3-256
|
||||
[%d] => sha3-384
|
||||
[%d] => sha3-512
|
||||
[%d] => ripemd128
|
||||
[%d] => ripemd160
|
||||
[%d] => ripemd256
|
||||
[%d] => ripemd320
|
||||
[%d] => whirlpool
|
||||
[%d] => tiger128,3
|
||||
[%d] => tiger160,3
|
||||
[%d] => tiger192,3
|
||||
[%d] => tiger128,4
|
||||
[%d] => tiger160,4
|
||||
[%d] => tiger192,4
|
||||
[%d] => snefru
|
||||
[%d] => snefru256
|
||||
[%d] => gost
|
||||
[%d] => gost-crypto
|
||||
[%d] => haval128,3
|
||||
[%d] => haval160,3
|
||||
[%d] => haval192,3
|
||||
[%d] => haval224,3
|
||||
[%d] => haval256,3
|
||||
[%d] => haval128,4
|
||||
[%d] => haval160,4
|
||||
[%d] => haval192,4
|
||||
[%d] => haval224,4
|
||||
[%d] => haval256,4
|
||||
[%d] => haval128,5
|
||||
[%d] => haval160,5
|
||||
[%d] => haval192,5
|
||||
[%d] => haval224,5
|
||||
[%d] => haval256,5
|
||||
)
|
||||
@@ -173,6 +173,24 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3)
|
||||
ZEND_ARG_INFO(1, position)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 )
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, in_locale)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_ARG_INFO(0, def)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -180,24 +198,6 @@ ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_2_args, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_3_args, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_4_args, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_ARG_INFO(0, arg4)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define intl_0_args collator_static_0_args
|
||||
#define intl_1_arg collator_static_1_arg
|
||||
|
||||
@@ -670,17 +670,17 @@ zend_function_entry intl_functions[] = {
|
||||
PHP_FE( locale_get_script, locale_1_arg )
|
||||
PHP_FE( locale_get_region, locale_1_arg )
|
||||
PHP_FE( locale_get_keywords, locale_1_arg )
|
||||
PHP_FE( locale_get_display_script, locale_2_args )
|
||||
PHP_FE( locale_get_display_region, locale_2_args )
|
||||
PHP_FE( locale_get_display_name, locale_2_args )
|
||||
PHP_FE( locale_get_display_language, locale_2_args)
|
||||
PHP_FE( locale_get_display_variant, locale_2_args )
|
||||
PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args)
|
||||
PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_compose, locale_1_arg )
|
||||
PHP_FE( locale_parse, locale_1_arg )
|
||||
PHP_FE( locale_get_all_variants, locale_1_arg )
|
||||
PHP_FE( locale_filter_matches, locale_3_args )
|
||||
PHP_FE( locale_filter_matches, locale_filter_matches_args )
|
||||
PHP_FE( locale_canonicalize, locale_1_arg )
|
||||
PHP_FE( locale_lookup, locale_4_args )
|
||||
PHP_FE( locale_lookup, locale_lookup_args )
|
||||
PHP_FE( locale_accept_from_http, locale_1_arg )
|
||||
|
||||
/* MessageFormatter functions */
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
--TEST--
|
||||
Bug #74993 Wrong reflection on some locale_* functions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('intl') || print 'skip';
|
||||
--FILE--
|
||||
<?php
|
||||
$funcs = [
|
||||
'locale_get_display_language',
|
||||
'locale_get_display_name',
|
||||
'locale_get_display_region',
|
||||
'locale_get_display_script',
|
||||
'locale_get_display_variant',
|
||||
'locale_filter_matches',
|
||||
'locale_lookup',
|
||||
];
|
||||
|
||||
foreach ($funcs as $func) {
|
||||
echo (new ReflectionFunction($func));
|
||||
}
|
||||
--EXPECT--
|
||||
Function [ <internal:intl> function locale_get_display_language ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_name ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_region ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_script ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_variant ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_filter_matches ] {
|
||||
|
||||
- Parameters [3] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_lookup ] {
|
||||
|
||||
- Parameters [4] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
Parameter #3 [ <optional> $def ]
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ echo $orstr,"\n";
|
||||
echo $new_str,"\n";
|
||||
echo $recovstr,"\n";
|
||||
|
||||
var_dump(($orstr == $recovstr) == $recovstr2);
|
||||
var_dump($orstr === $recovstr);
|
||||
var_dump($orstr === $recovstr2);
|
||||
|
||||
echo "Done.\n";
|
||||
--EXPECT--
|
||||
@@ -29,4 +30,5 @@ echo "Done.\n";
|
||||
ōshanbyū
|
||||
オーシャンビュー
|
||||
bool(true)
|
||||
bool(true)
|
||||
Done.
|
||||
@@ -19,6 +19,6 @@ if (PHP_JSON != "no") {
|
||||
|
||||
ADD_MAKEFILE_FRAGMENT();
|
||||
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h php_json_parser.h php_json_scanner.h");
|
||||
}
|
||||
|
||||
@@ -292,6 +292,8 @@ yy14:
|
||||
{
|
||||
s->str_start = s->cursor;
|
||||
s->str_esc = 0;
|
||||
s->utf8_invalid = 0;
|
||||
s->utf8_invalid_count = 0;
|
||||
PHP_JSON_CONDITION_SET_AND_GOTO(STR_P1);
|
||||
}
|
||||
yy16:
|
||||
@@ -638,9 +640,16 @@ yy79:
|
||||
yy80:
|
||||
{
|
||||
if (s->options & (PHP_JSON_INVALID_UTF8_IGNORE | PHP_JSON_INVALID_UTF8_SUBSTITUTE)) {
|
||||
int utf8_addition = (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) ? 3 : 0;
|
||||
if (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) {
|
||||
if (s->utf8_invalid_count > INT_MAX - 2) {
|
||||
s->errcode = PHP_JSON_ERROR_UTF8;
|
||||
return PHP_JSON_T_ERROR;
|
||||
}
|
||||
s->utf8_invalid_count += 2;
|
||||
} else {
|
||||
s->utf8_invalid_count--;
|
||||
}
|
||||
s->utf8_invalid = 1;
|
||||
s->utf8_invalid_count += utf8_addition - 1;
|
||||
PHP_JSON_CONDITION_GOTO(STR_P1);
|
||||
}
|
||||
s->errcode = PHP_JSON_ERROR_UTF8;
|
||||
|
||||
@@ -209,6 +209,8 @@ std:
|
||||
<JS>["] {
|
||||
s->str_start = s->cursor;
|
||||
s->str_esc = 0;
|
||||
s->utf8_invalid = 0;
|
||||
s->utf8_invalid_count = 0;
|
||||
PHP_JSON_CONDITION_SET_AND_GOTO(STR_P1);
|
||||
}
|
||||
<JS>CTRL {
|
||||
@@ -280,9 +282,16 @@ std:
|
||||
<STR_P1>UTF8 { PHP_JSON_CONDITION_GOTO(STR_P1); }
|
||||
<STR_P1>ANY {
|
||||
if (s->options & (PHP_JSON_INVALID_UTF8_IGNORE | PHP_JSON_INVALID_UTF8_SUBSTITUTE)) {
|
||||
int utf8_addition = (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) ? 3 : 0;
|
||||
if (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) {
|
||||
if (s->utf8_invalid_count > INT_MAX - 2) {
|
||||
s->errcode = PHP_JSON_ERROR_UTF8;
|
||||
return PHP_JSON_T_ERROR;
|
||||
}
|
||||
s->utf8_invalid_count += 2;
|
||||
} else {
|
||||
s->utf8_invalid_count--;
|
||||
}
|
||||
s->utf8_invalid = 1;
|
||||
s->utf8_invalid_count += utf8_addition - 1;
|
||||
PHP_JSON_CONDITION_GOTO(STR_P1);
|
||||
}
|
||||
s->errcode = PHP_JSON_ERROR_UTF8;
|
||||
|
||||
@@ -9,11 +9,17 @@ if (!extension_loaded("json")) print "skip";
|
||||
function json_decode_invalid_utf8($str) {
|
||||
var_dump(json_decode($str));
|
||||
var_dump(json_decode($str, true, 512, JSON_INVALID_UTF8_IGNORE));
|
||||
var_dump(bin2hex(json_decode($str, true, 512, JSON_INVALID_UTF8_SUBSTITUTE)));
|
||||
$json = json_decode($str, true, 512, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||
if (is_array($json)) {
|
||||
var_dump(array_map(function($item) { return bin2hex($item); }, $json));
|
||||
} else {
|
||||
var_dump(bin2hex($json));
|
||||
}
|
||||
}
|
||||
json_decode_invalid_utf8("\"a\xb0b\"");
|
||||
json_decode_invalid_utf8("\"a\xd0\xf2b\"");
|
||||
json_decode_invalid_utf8("\"\x61\xf0\x80\x80\x41\"");
|
||||
json_decode_invalid_utf8("[\"\xc1\xc1\",\"a\"]");
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -26,4 +32,17 @@ string(16) "61efbfbdefbfbd62"
|
||||
NULL
|
||||
string(2) "aA"
|
||||
string(22) "61efbfbdefbfbdefbfbd41"
|
||||
NULL
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(0) ""
|
||||
[1]=>
|
||||
string(1) "a"
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(12) "efbfbdefbfbd"
|
||||
[1]=>
|
||||
string(2) "61"
|
||||
}
|
||||
Done
|
||||
@@ -3322,10 +3322,11 @@ PHP_FUNCTION(ldap_control_paged_result_response)
|
||||
|
||||
/* {{{ Extended operations, Pierangelo Masarati */
|
||||
#ifdef HAVE_LDAP_EXTENDED_OPERATION_S
|
||||
/* {{{ proto ? ldap_exop(resource link, string reqoid [, string reqdata [, string retdata [, string retoid]]])
|
||||
/* {{{ proto resource ldap_exop(resource link, string reqoid [, string reqdata [, array servercontrols [, array clientcontrols [, string &retdata [, string &retoid]]]]])
|
||||
Extended operation */
|
||||
PHP_FUNCTION(ldap_exop)
|
||||
{
|
||||
zval *servercontrols, *clientcontrols;
|
||||
zval *link, *reqoid, *reqdata, *retdata, *retoid;
|
||||
char *lreqoid, *lretoid = NULL;
|
||||
struct berval lreqdata, *lretdata = NULL;
|
||||
@@ -3334,7 +3335,7 @@ PHP_FUNCTION(ldap_exop)
|
||||
int rc, msgid, myargcount = ZEND_NUM_ARGS();
|
||||
/* int reqoid_len, reqdata_len, retdata_len, retoid_len, retdat_len; */
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz|zz/z/", &link, &reqoid, &reqdata, &retdata, &retoid) != SUCCESS) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz|zzzz/z/", &link, &reqoid, &reqdata, &servercontrols, &clientcontrols, &retdata, &retoid) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
@@ -3343,6 +3344,8 @@ PHP_FUNCTION(ldap_exop)
|
||||
}
|
||||
|
||||
switch (myargcount) {
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
@@ -3355,13 +3358,13 @@ PHP_FUNCTION(ldap_exop)
|
||||
lreqoid = Z_STRVAL_P(reqoid);
|
||||
}
|
||||
|
||||
if (myargcount > 3) {
|
||||
if (myargcount > 5) {
|
||||
/* synchronous call */
|
||||
rc = ldap_extended_operation_s(ld->link, lreqoid,
|
||||
lreqdata.bv_len > 0 ? &lreqdata: NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
myargcount > 4 ? &lretoid : NULL,
|
||||
myargcount > 6 ? &lretoid : NULL,
|
||||
&lretdata );
|
||||
if (rc != LDAP_SUCCESS ) {
|
||||
php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)", lreqoid, ldap_err2string(rc), rc);
|
||||
@@ -3370,7 +3373,7 @@ PHP_FUNCTION(ldap_exop)
|
||||
|
||||
/* Reverse -> fall through */
|
||||
switch (myargcount) {
|
||||
case 5:
|
||||
case 7:
|
||||
zval_dtor(retoid);
|
||||
if (lretoid == NULL) {
|
||||
ZVAL_EMPTY_STRING(retoid);
|
||||
@@ -3378,7 +3381,7 @@ PHP_FUNCTION(ldap_exop)
|
||||
ZVAL_STRING(retoid, lretoid);
|
||||
ldap_memfree(lretoid);
|
||||
}
|
||||
case 4:
|
||||
case 6:
|
||||
/* use arg #4 as the data returned by the server */
|
||||
zval_dtor(retdata);
|
||||
if (lretdata == NULL) {
|
||||
@@ -3794,10 +3797,12 @@ ZEND_END_ARG_INFO()
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LDAP_EXTENDED_OPERATION_S
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop, 0, 0, 5)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, link)
|
||||
ZEND_ARG_INFO(0, reqoid)
|
||||
ZEND_ARG_INFO(0, reqdata)
|
||||
ZEND_ARG_INFO(0, servercontrols)
|
||||
ZEND_ARG_INFO(0, clientcontrols)
|
||||
ZEND_ARG_INFO(1, retdata)
|
||||
ZEND_ARG_INFO(1, retoid)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -36,10 +36,10 @@ function extract_genpw($retdata)
|
||||
|
||||
$userAPassword = "oops";
|
||||
|
||||
// ldap_exop(resource link, string reqoid [, string reqdata [, string retoid [, string retdata]]])
|
||||
// bool ldap_parse_exop(resource link, resource result [, string retoid [, string retdata]])
|
||||
// ldap_exop(resource link, string reqoid [, string reqdata [, array servercontrols [, array clientcontrols [, string &retdata [, string &retoid]]]]])
|
||||
// bool ldap_parse_exop(resource link, resource result [, string &retdata [, string &retoid]])
|
||||
var_dump(
|
||||
ldap_exop($link, LDAP_EXOP_WHO_AM_I, NULL, $retdata, $retoid),
|
||||
ldap_exop($link, LDAP_EXOP_WHO_AM_I, NULL, NULL, NULL, $retdata, $retoid),
|
||||
$retdata,
|
||||
$retoid,
|
||||
$r = ldap_exop($link, LDAP_EXOP_WHO_AM_I),
|
||||
|
||||
@@ -88,7 +88,8 @@ const struct mbfl_convert_vtbl vtbl_html_wchar = {
|
||||
mbfl_filt_conv_html_dec_ctor,
|
||||
mbfl_filt_conv_html_dec_dtor,
|
||||
mbfl_filt_conv_html_dec,
|
||||
mbfl_filt_conv_html_dec_flush };
|
||||
mbfl_filt_conv_html_dec_flush,
|
||||
mbfl_filt_conv_html_dec_copy };
|
||||
|
||||
|
||||
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0)
|
||||
@@ -309,4 +310,9 @@ int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest)
|
||||
{
|
||||
*dest = *src;
|
||||
dest->opaque = mbfl_malloc(html_enc_buffer_size+1);
|
||||
memcpy(dest->opaque, src->opaque, html_enc_buffer_size+1);
|
||||
}
|
||||
@@ -42,6 +42,7 @@ int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest);
|
||||
void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter);
|
||||
|
||||
|
||||
@@ -222,11 +222,11 @@ mbfl_filt_tl_jisx0201_jisx0208(int c, mbfl_convert_filter *filt)
|
||||
} else if (mode & (MBFL_FILT_TL_ZEN2HAN_HIRA2KANA
|
||||
| MBFL_FILT_TL_ZEN2HAN_KANA2HIRA)) {
|
||||
if ((mode & MBFL_FILT_TL_ZEN2HAN_HIRA2KANA) &&
|
||||
c >= 0x3041 && c <= 0x3093) {
|
||||
((c >= 0x3041 && c <= 0x3093) || c == 0x309d || c == 0x309e)) {
|
||||
/* Zenkaku hirangana to Zenkaku katakana */
|
||||
s = c + 0x60;
|
||||
} else if ((mode & MBFL_FILT_TL_ZEN2HAN_KANA2HIRA) &&
|
||||
c >= 0x30a1 && c <= 0x30f3) {
|
||||
((c >= 0x30a1 && c <= 0x30f3) || c == 0x30fd || c == 0x30fe)) {
|
||||
/* Zenkaku katakana to Zenkaku hirangana */
|
||||
s = c - 0x60;
|
||||
}
|
||||
|
||||
@@ -467,14 +467,26 @@ int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char
|
||||
int
|
||||
mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
|
||||
{
|
||||
int mode_backup, ret, n, m, r;
|
||||
int mode_backup, substchar_backup, ret, n, m, r;
|
||||
|
||||
ret = 0;
|
||||
|
||||
mode_backup = filter->illegal_mode;
|
||||
filter->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE;
|
||||
substchar_backup = filter->illegal_substchar;
|
||||
|
||||
/* The used substitution character may not be supported by the target character encoding.
|
||||
* If that happens, first try to use "?" instead and if that also fails, silently drop the
|
||||
* character. */
|
||||
if (filter->illegal_mode == MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR
|
||||
&& filter->illegal_substchar != 0x3f) {
|
||||
filter->illegal_substchar = 0x3f;
|
||||
} else {
|
||||
filter->illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE;
|
||||
}
|
||||
|
||||
switch (mode_backup) {
|
||||
case MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR:
|
||||
ret = (*filter->filter_function)(filter->illegal_substchar, filter);
|
||||
ret = (*filter->filter_function)(substchar_backup, filter);
|
||||
break;
|
||||
case MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG:
|
||||
if (c >= 0) {
|
||||
@@ -560,14 +572,16 @@ mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
|
||||
}
|
||||
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)";");
|
||||
} else {
|
||||
ret = (*filter->filter_function)(filter->illegal_substchar, filter);
|
||||
ret = (*filter->filter_function)(substchar_backup, filter);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
filter->illegal_mode = mode_backup;
|
||||
filter->illegal_substchar = substchar_backup;
|
||||
filter->num_illegalchar++;
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -106,8 +106,6 @@ static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding);
|
||||
|
||||
static inline zend_bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc);
|
||||
|
||||
static inline zend_bool php_mb_is_no_encoding_unicode(enum mbfl_no_encoding no_enc);
|
||||
|
||||
static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc);
|
||||
/* }}} */
|
||||
|
||||
@@ -477,6 +475,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_eregi_replace, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, pattern)
|
||||
ZEND_ARG_INFO(0, replacement)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
ZEND_ARG_INFO(0, option)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3)
|
||||
@@ -936,6 +935,7 @@ static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_leng
|
||||
if (convd == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
|
||||
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
|
||||
|
||||
@@ -1977,69 +1977,21 @@ PHP_FUNCTION(mb_detect_order)
|
||||
|
||||
static inline int php_mb_check_code_point(long cp)
|
||||
{
|
||||
enum mbfl_no_encoding no_enc;
|
||||
char* buf;
|
||||
char buf_len;
|
||||
|
||||
no_enc = MBSTRG(current_internal_encoding)->no_encoding;
|
||||
|
||||
if (php_mb_is_no_encoding_utf8(no_enc)) {
|
||||
|
||||
if ((cp > 0 && 0xd800 > cp) || (cp > 0xdfff && 0x110000 > cp)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (cp <= 0 || cp >= 0x110000) {
|
||||
/* Out of Unicode range */
|
||||
return 0;
|
||||
} else if (php_mb_is_no_encoding_unicode(no_enc)) {
|
||||
|
||||
if (0 > cp || cp > 0x10ffff) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
// backward compatibility
|
||||
} else if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
return cp < 0xffff && cp > 0x0;
|
||||
}
|
||||
|
||||
if (cp < 0x100) {
|
||||
buf_len = 1;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp;
|
||||
buf[1] = 0;
|
||||
} else if (cp < 0x10000) {
|
||||
buf_len = 2;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 8;
|
||||
buf[1] = cp & 0xff;
|
||||
buf[2] = 0;
|
||||
} else if (cp < 0x1000000) {
|
||||
buf_len = 3;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 16;
|
||||
buf[1] = (cp >> 8) & 0xff;
|
||||
buf[2] = cp & 0xff;
|
||||
buf[3] = 0;
|
||||
} else {
|
||||
buf_len = 4;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 24;
|
||||
buf[1] = (cp >> 16) & 0xff;
|
||||
buf[2] = (cp >> 8) & 0xff;
|
||||
buf[3] = cp & 0xff;
|
||||
buf[4] = 0;
|
||||
if (cp >= 0xd800 && cp <= 0xdfff) {
|
||||
/* Surrogate code-point. These are never valid on their own and we only allow a single
|
||||
* substitute character. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (php_mb_check_encoding(buf, buf_len, NULL)) {
|
||||
efree(buf);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
efree(buf);
|
||||
|
||||
return 0;
|
||||
/* As the we do not know the target encoding of the conversion operation that is going to
|
||||
* use the substitution character, we cannot check whether the codepoint is actually mapped
|
||||
* in the given encoding at this point. Thus we have to accept everything. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* {{{ proto mixed mb_substitute_character([mixed substchar])
|
||||
@@ -2080,7 +2032,7 @@ PHP_FUNCTION(mb_substitute_character)
|
||||
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
|
||||
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "Unknown character.");
|
||||
php_error_docref(NULL, E_WARNING, "Unknown character");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2091,7 +2043,7 @@ PHP_FUNCTION(mb_substitute_character)
|
||||
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
|
||||
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "Unknown character.");
|
||||
php_error_docref(NULL, E_WARNING, "Unknown character");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -3218,13 +3170,6 @@ static inline zend_bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding
|
||||
}
|
||||
|
||||
|
||||
/* See mbfl_no_encoding definition for list of unicode encodings */
|
||||
static inline zend_bool php_mb_is_no_encoding_unicode(enum mbfl_no_encoding no_enc)
|
||||
{
|
||||
return (no_enc >= mbfl_no_encoding_ucs4 && no_enc <= mbfl_no_encoding_utf8_sb);
|
||||
}
|
||||
|
||||
|
||||
/* See mbfl_no_encoding definition for list of UTF-8 encodings */
|
||||
static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc)
|
||||
{
|
||||
@@ -3301,29 +3246,9 @@ MBSTRING_API char *php_mb_convert_encoding(const char *input, size_t length, con
|
||||
php_error_docref(NULL, E_WARNING, "Unable to create character encoding converter");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
|
||||
|
||||
if (string.no_encoding == MBSTRG(current_internal_encoding)->no_encoding) {
|
||||
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
|
||||
} else if (php_mb_is_no_encoding_unicode(string.no_encoding) && php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
|
||||
|
||||
if (php_mb_is_no_encoding_utf8(string.no_encoding)) {
|
||||
|
||||
if (MBSTRG(current_filter_illegal_substchar) > 0xd7ff &&
|
||||
0xe000 > MBSTRG(current_filter_illegal_substchar)
|
||||
) {
|
||||
mbfl_buffer_converter_illegal_substchar(convd, 0x3f);
|
||||
} else {
|
||||
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
|
||||
}
|
||||
|
||||
} else {
|
||||
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
|
||||
}
|
||||
|
||||
} else {
|
||||
mbfl_buffer_converter_illegal_substchar(convd, 0x3f);
|
||||
}
|
||||
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
|
||||
|
||||
/* do it */
|
||||
ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
|
||||
@@ -4685,10 +4610,10 @@ PHP_FUNCTION(mb_send_mail)
|
||||
p = ZSTR_VAL(str_headers);
|
||||
n = ZSTR_LEN(str_headers);
|
||||
mbfl_memory_device_strncat(&device, p, n);
|
||||
zend_string_release(str_headers);
|
||||
if (n > 0 && p[n - 1] != '\n') {
|
||||
mbfl_memory_device_strncat(&device, "\n", 1);
|
||||
}
|
||||
zend_string_release(str_headers);
|
||||
}
|
||||
|
||||
if (!zend_hash_str_exists(&ht_headers, "MIME-VERSION", sizeof("MIME-VERSION") - 1)) {
|
||||
@@ -5131,8 +5056,6 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
|
||||
enum mbfl_no_encoding no_enc;
|
||||
char* ret;
|
||||
size_t ret_len;
|
||||
const mbfl_encoding *encoding;
|
||||
unsigned char char_len;
|
||||
zend_long cp;
|
||||
|
||||
if (enc == NULL) {
|
||||
@@ -5146,52 +5069,39 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
|
||||
}
|
||||
}
|
||||
|
||||
if (php_mb_is_no_encoding_unicode(no_enc)) {
|
||||
|
||||
ret = php_mb_convert_encoding(str, str_len, "UCS-4BE", enc, &ret_len);
|
||||
|
||||
if (ret == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
cp = (unsigned char) ret[0] << 24 | \
|
||||
(unsigned char) ret[1] << 16 | \
|
||||
(unsigned char) ret[2] << 8 | \
|
||||
(unsigned char) ret[3];
|
||||
|
||||
efree(ret);
|
||||
|
||||
return cp;
|
||||
|
||||
} else if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = php_mb_convert_encoding(str, str_len, enc, enc, &ret_len);
|
||||
if (str_len == 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Empty string");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
long orig_illegalchars = MBSTRG(illegalchars);
|
||||
MBSTRG(illegalchars) = 0;
|
||||
ret = php_mb_convert_encoding(str, str_len, "UCS-4BE", enc, &ret_len);
|
||||
if (MBSTRG(illegalchars) != 0) {
|
||||
if (ret) {
|
||||
efree(ret);
|
||||
}
|
||||
MBSTRG(illegalchars) = orig_illegalchars;
|
||||
return -1;
|
||||
}
|
||||
|
||||
MBSTRG(illegalchars) = orig_illegalchars;
|
||||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
encoding = mbfl_no2encoding(no_enc);
|
||||
char_len = php_mb_mbchar_bytes_ex(ret, encoding);
|
||||
|
||||
if (char_len == 1) {
|
||||
cp = (unsigned char) ret[0];
|
||||
} else if (char_len == 2) {
|
||||
cp = ((unsigned char) ret[0] << 8) | \
|
||||
(unsigned char) ret[1];
|
||||
} else if (char_len == 3) {
|
||||
cp = ((unsigned char) ret[0] << 16) | \
|
||||
((unsigned char) ret[1] << 8) | \
|
||||
(unsigned char) ret[2];
|
||||
} else {
|
||||
cp = ((unsigned char) ret[0] << 24) | \
|
||||
((unsigned char) ret[1] << 16) | \
|
||||
((unsigned char) ret[2] << 8) | \
|
||||
(unsigned char) ret[3];
|
||||
}
|
||||
cp = (unsigned char) ret[0] << 24 | \
|
||||
(unsigned char) ret[1] << 16 | \
|
||||
(unsigned char) ret[2] << 8 | \
|
||||
(unsigned char) ret[3];
|
||||
|
||||
efree(ret);
|
||||
|
||||
@@ -5243,20 +5153,18 @@ static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len
|
||||
}
|
||||
}
|
||||
|
||||
if (php_mb_is_no_encoding_utf8(no_enc)) {
|
||||
if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (0 > cp || cp > 0x10ffff || (cp > 0xd7ff && 0xe000 > cp)) {
|
||||
if (php_mb_is_no_encoding_utf8(MBSTRG(current_internal_encoding)->no_encoding)) {
|
||||
cp = MBSTRG(current_filter_illegal_substchar);
|
||||
} else if (php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
|
||||
if (0xd800 > MBSTRG(current_filter_illegal_substchar) || MBSTRG(current_filter_illegal_substchar) > 0xdfff) {
|
||||
cp = MBSTRG(current_filter_illegal_substchar);
|
||||
} else {
|
||||
cp = 0x3f;
|
||||
}
|
||||
} else {
|
||||
cp = 0x3f;
|
||||
}
|
||||
if (cp < 0 || cp > 0x10ffff) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (php_mb_is_no_encoding_utf8(no_enc)) {
|
||||
if (cp > 0xd7ff && 0xe000 > cp) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cp < 0x80) {
|
||||
@@ -5292,80 +5200,31 @@ static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} else if (php_mb_is_no_encoding_unicode(no_enc)) {
|
||||
|
||||
if (0 > cp || 0x10ffff < cp) {
|
||||
|
||||
if (php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
|
||||
cp = MBSTRG(current_filter_illegal_substchar);
|
||||
} else {
|
||||
cp = 0x3f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buf_len = 4;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = (cp >> 24) & 0xff;
|
||||
buf[1] = (cp >> 16) & 0xff;
|
||||
buf[2] = (cp >> 8) & 0xff;
|
||||
buf[3] = cp & 0xff;
|
||||
buf[4] = 0;
|
||||
buf_len = 4;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = (cp >> 24) & 0xff;
|
||||
buf[1] = (cp >> 16) & 0xff;
|
||||
buf[2] = (cp >> 8) & 0xff;
|
||||
buf[3] = cp & 0xff;
|
||||
buf[4] = 0;
|
||||
|
||||
{
|
||||
long orig_illegalchars = MBSTRG(illegalchars);
|
||||
MBSTRG(illegalchars) = 0;
|
||||
ret = php_mb_convert_encoding(buf, buf_len, enc, "UCS-4BE", &ret_len);
|
||||
efree(buf);
|
||||
|
||||
if (output_len) {
|
||||
*output_len = ret_len;
|
||||
if (MBSTRG(illegalchars) != 0) {
|
||||
efree(buf);
|
||||
efree(ret);
|
||||
MBSTRG(illegalchars) = orig_illegalchars;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
} else if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
|
||||
return NULL;
|
||||
MBSTRG(illegalchars) = orig_illegalchars;
|
||||
}
|
||||
|
||||
if (0 > cp || cp > 0x100000000) {
|
||||
if (no_enc == MBSTRG(current_internal_encoding)->no_encoding) {
|
||||
cp = MBSTRG(current_filter_illegal_substchar);
|
||||
} else {
|
||||
cp = 0x3f;
|
||||
}
|
||||
}
|
||||
|
||||
if (cp < 0x100) {
|
||||
buf_len = 1;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp;
|
||||
buf[1] = 0;
|
||||
} else if (cp < 0x10000) {
|
||||
buf_len = 2;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 8;
|
||||
buf[1] = cp & 0xff;
|
||||
buf[2] = 0;
|
||||
} else if (cp < 0x1000000) {
|
||||
buf_len = 3;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 16;
|
||||
buf[1] = (cp >> 8) & 0xff;
|
||||
buf[2] = cp & 0xff;
|
||||
buf[3] = 0;
|
||||
} else {
|
||||
buf_len = 4;
|
||||
buf = (char *) safe_emalloc(buf_len, 1, 1);
|
||||
buf[0] = cp >> 24;
|
||||
buf[1] = (cp >> 16) & 0xff;
|
||||
buf[2] = (cp >> 8) & 0xff;
|
||||
buf[3] = cp & 0xff;
|
||||
buf[4] = 0;
|
||||
}
|
||||
|
||||
ret = php_mb_convert_encoding(buf, buf_len, enc, enc, &ret_len);
|
||||
efree(buf);
|
||||
|
||||
if (output_len) {
|
||||
*output_len = ret_len;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
|
||||
static unsigned long case_lookup(unsigned long code, long l, long r, int field)
|
||||
{
|
||||
long m;
|
||||
const unsigned int *tmp;
|
||||
|
||||
/*
|
||||
* Do the binary search.
|
||||
@@ -132,13 +133,13 @@ static unsigned long case_lookup(unsigned long code, long l, long r, int field)
|
||||
* the beginning of a case mapping triple.
|
||||
*/
|
||||
m = (l + r) >> 1;
|
||||
m -= (m % 3);
|
||||
if (code > _uccase_map[m])
|
||||
l = m + 3;
|
||||
else if (code < _uccase_map[m])
|
||||
r = m - 3;
|
||||
else if (code == _uccase_map[m])
|
||||
return _uccase_map[m + field];
|
||||
tmp = &_uccase_map[m*3];
|
||||
if (code > *tmp)
|
||||
l = m + 1;
|
||||
else if (code < *tmp)
|
||||
r = m - 1;
|
||||
else if (code == *tmp)
|
||||
return tmp[field];
|
||||
}
|
||||
|
||||
return code;
|
||||
@@ -172,9 +173,9 @@ MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_
|
||||
/*
|
||||
* The character is lower case.
|
||||
*/
|
||||
field = 2;
|
||||
field = 1;
|
||||
l = _uccase_len[0];
|
||||
r = (l + _uccase_len[1]) - 3;
|
||||
r = (l + _uccase_len[1]) - 1;
|
||||
|
||||
if (enc == mbfl_no_encoding_8859_9) {
|
||||
return php_turkish_toupper(code, l, r, field);
|
||||
@@ -186,7 +187,7 @@ MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_
|
||||
*/
|
||||
field = 1;
|
||||
l = _uccase_len[0] + _uccase_len[1];
|
||||
r = _uccase_size - 3;
|
||||
r = _uccase_size - 1;
|
||||
}
|
||||
return case_lookup(code, l, r, field);
|
||||
}
|
||||
@@ -205,7 +206,7 @@ MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_
|
||||
*/
|
||||
field = 1;
|
||||
l = 0;
|
||||
r = _uccase_len[0] - 3;
|
||||
r = _uccase_len[0] - 1;
|
||||
|
||||
if (enc == mbfl_no_encoding_8859_9) {
|
||||
return php_turkish_tolower(code, l, r, field);
|
||||
@@ -217,7 +218,7 @@ MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_
|
||||
*/
|
||||
field = 2;
|
||||
l = _uccase_len[0] + _uccase_len[1];
|
||||
r = _uccase_size - 3;
|
||||
r = _uccase_size - 1;
|
||||
}
|
||||
return case_lookup(code, l, r, field);
|
||||
}
|
||||
@@ -240,13 +241,13 @@ MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_
|
||||
* The character is upper case.
|
||||
*/
|
||||
l = 0;
|
||||
r = _uccase_len[0] - 3;
|
||||
r = _uccase_len[0] - 1;
|
||||
} else {
|
||||
/*
|
||||
* The character is lower case.
|
||||
*/
|
||||
l = _uccase_len[0];
|
||||
r = (l + _uccase_len[1]) - 3;
|
||||
r = (l + _uccase_len[1]) - 1;
|
||||
}
|
||||
return case_lookup(code, l, r, field);
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #62934: mb_convert_kana() does not convert iteration marks
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'C', 'UTF-8') . "\n";
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'c', 'UTF-8') . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
アヽスヾメアヽスヾメ
|
||||
あゝすゞめあゝすゞめ
|
||||
@@ -4,11 +4,32 @@ Bug #69079 (enhancement for mb_substitute_character)
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
mb_internal_encoding('UTF-8');
|
||||
var_dump(mb_substitute_character(0x1f600));
|
||||
var_dump(mb_substitute_character(0x1F600));
|
||||
var_dump(bin2hex(mb_scrub("\xff")));
|
||||
mb_substitute_character(0x3f); // Reset to '?', as the next call will fail
|
||||
var_dump(mb_substitute_character(0xD800)); // Surrogate (illegal)
|
||||
var_dump(bin2hex(mb_scrub("\xff")));
|
||||
|
||||
mb_internal_encoding('EUC-JP-2004');
|
||||
var_dump(mb_substitute_character(0x8fa1ef));
|
||||
|
||||
mb_substitute_character(0x63); // Reset to '?', as the next call will fail
|
||||
mb_substitute_character(0x8fa1ef); // EUC-JP-2004 encoding of U+50AA (illegal)
|
||||
var_dump(bin2hex(mb_scrub("\x8d")));
|
||||
|
||||
mb_substitute_character(0x50aa);
|
||||
var_dump(bin2hex(mb_scrub("\x8d")));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
string(8) "f09f9880"
|
||||
|
||||
Warning: mb_substitute_character(): Unknown character in %s on line %d
|
||||
bool(false)
|
||||
string(2) "3f"
|
||||
|
||||
Warning: mb_substitute_character(): Unknown character in %s on line %d
|
||||
string(2) "63"
|
||||
string(6) "8fa1ef"
|
||||
@@ -8,10 +8,13 @@ mb_substitute_character(0xfffd);
|
||||
var_dump("?" === mb_convert_encoding("\x80", "Shift_JIS", "EUC-JP"));
|
||||
mb_internal_encoding("UCS-4BE");
|
||||
var_dump("\x00\x00\xff\xfd" === mb_convert_encoding("\x80", "UCS-4BE", "UTF-8"));
|
||||
mb_substitute_character(0xd800);
|
||||
var_dump("\x00\x00\x00\x3f" === mb_convert_encoding("\x80", "UCS-4BE", "UTF-8"));
|
||||
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_substitute_character(0xfffd);
|
||||
var_dump("\u{fffd}" === mb_convert_encoding("\x80", "UTF-8", "EUC-JP-2004"));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Bug #69267: mb_strtolower fails on titlecase characters
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str_l = "džljnjdz";
|
||||
$str_u = "DŽLJNJDZ";
|
||||
$str_t = "DžLjNjDz";
|
||||
var_dump(mb_strtolower($str_l));
|
||||
var_dump(mb_strtolower($str_u));
|
||||
var_dump(mb_strtolower($str_t));
|
||||
var_dump(mb_strtoupper($str_l));
|
||||
var_dump(mb_strtoupper($str_u));
|
||||
var_dump(mb_strtoupper($str_t));
|
||||
var_dump(mb_convert_case($str_l, MB_CASE_TITLE));
|
||||
var_dump(mb_convert_case($str_u, MB_CASE_TITLE));
|
||||
var_dump(mb_convert_case($str_t, MB_CASE_TITLE));
|
||||
|
||||
$str_l = "ᾳ";
|
||||
$str_t = "ᾼ";
|
||||
var_dump(mb_strtolower($str_l));
|
||||
var_dump(mb_strtolower($str_t));
|
||||
var_dump(mb_strtoupper($str_l));
|
||||
var_dump(mb_strtoupper($str_t));
|
||||
var_dump(mb_convert_case($str_l, MB_CASE_TITLE));
|
||||
var_dump(mb_convert_case($str_t, MB_CASE_TITLE));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(8) "džljnjdz"
|
||||
string(8) "džljnjdz"
|
||||
string(8) "džljnjdz"
|
||||
string(8) "DŽLJNJDZ"
|
||||
string(8) "DŽLJNJDZ"
|
||||
string(8) "DŽLJNJDZ"
|
||||
string(8) "Džljnjdz"
|
||||
string(8) "Džljnjdz"
|
||||
string(8) "Džljnjdz"
|
||||
string(3) "ᾳ"
|
||||
string(3) "ᾳ"
|
||||
string(3) "ᾼ"
|
||||
string(3) "ᾼ"
|
||||
string(3) "ᾼ"
|
||||
string(3) "ᾼ"
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #71606 (Segmentation fault mb_strcut + mb_list_encodings)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip ext/mbstring not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_strcut('"', 0, 0, 'HTML-ENTITIES');
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -6,24 +6,9 @@ mb_chr()
|
||||
<?php
|
||||
var_dump(
|
||||
"\u{20bb7}" === mb_chr(0x20bb7),
|
||||
"\x8f\xa1\xef" === mb_chr(0x8fa1ef, "EUC-JP-2004"),
|
||||
"?" === mb_chr(0xd800)
|
||||
);
|
||||
|
||||
mb_internal_encoding("UCS-4BE");
|
||||
mb_substitute_character(0xfffd);
|
||||
var_dump(
|
||||
"\u{fffd}" === mb_chr(0xd800, "UTF-8")
|
||||
);
|
||||
mb_substitute_character(0xd800);
|
||||
var_dump(
|
||||
"?" === mb_chr(0xd800, "UTF-8")
|
||||
);
|
||||
|
||||
mb_internal_encoding("EUC-JP");
|
||||
mb_substitute_character(0xa4a2);
|
||||
var_dump(
|
||||
"?" === mb_chr(0xd800, "UTF-8")
|
||||
"\x8f\xa1\xef" === mb_chr(0x50aa, "EUC-JP-2004"),
|
||||
false === mb_chr(0xd800),
|
||||
false === mb_chr(0x1f600, "EUC-JP-2004")
|
||||
);
|
||||
|
||||
// Invalid
|
||||
@@ -40,18 +25,16 @@ bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: mb_chr(): Unknown encoding "typo" in %s on line 26
|
||||
Warning: mb_chr(): Unknown encoding "typo" in %s on line %d
|
||||
|
||||
Warning: mb_chr(): Unsupported encoding "pass" in %s on line 27
|
||||
Warning: mb_chr(): Unsupported encoding "pass" in %s on line %d
|
||||
|
||||
Warning: mb_chr(): Unsupported encoding "jis" in %s on line 28
|
||||
Warning: mb_chr(): Unsupported encoding "jis" in %s on line %d
|
||||
|
||||
Warning: mb_chr(): Unsupported encoding "cp50222" in %s on line 29
|
||||
Warning: mb_chr(): Unsupported encoding "cp50222" in %s on line %d
|
||||
|
||||
Warning: mb_chr(): Unsupported encoding "utf-7" in %s on line 30
|
||||
Warning: mb_chr(): Unsupported encoding "utf-7" in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
@@ -6,7 +6,14 @@ mb_chr() and mb_ord()
|
||||
<?php
|
||||
ini_set('internal_encoding', 'utf-8');
|
||||
for($ch = 1; $ch < 80000; $ch++) {
|
||||
if ($ch !== mb_ord(mb_chr($ch))) echo "ERROR($ch)\n";
|
||||
$str = mb_chr($ch);
|
||||
if (false === $str) {
|
||||
echo "ERROR($ch)\n";
|
||||
continue;
|
||||
}
|
||||
if ($ch != mb_ord($str)) {
|
||||
echo "REAL ERROR($ch)\n";
|
||||
}
|
||||
}
|
||||
echo 'OK';
|
||||
--EXPECTF--
|
||||
|
||||
@@ -6,8 +6,8 @@ mb_ord()
|
||||
<?php
|
||||
var_dump(
|
||||
0x20bb7 === mb_ord("\u{20bb7}"),
|
||||
0x3f === mb_ord("\u{d800}"),
|
||||
0x8fa1ef === mb_ord("\x8f\xa1\xef", "EUC-JP-2004")
|
||||
false === mb_ord("\u{d800}"),
|
||||
0x50aa === mb_ord("\x8f\xa1\xef", "EUC-JP-2004")
|
||||
);
|
||||
|
||||
// Invalid
|
||||
@@ -16,7 +16,8 @@ var_dump(
|
||||
mb_ord("\u{d800}", "pass"),
|
||||
mb_ord("\u{d800}", "jis"),
|
||||
mb_ord("\u{d800}", "cp50222"),
|
||||
mb_ord("\u{d800}", "utf-7")
|
||||
mb_ord("\u{d800}", "utf-7"),
|
||||
mb_ord("")
|
||||
);
|
||||
?>
|
||||
--EXPECTF--
|
||||
@@ -33,6 +34,9 @@ Warning: mb_ord(): Unsupported encoding "jis" %s 12
|
||||
Warning: mb_ord(): Unsupported encoding "cp50222" %s 13
|
||||
|
||||
Warning: mb_ord(): Unsupported encoding "utf-7" %s 14
|
||||
|
||||
Warning: mb_ord(): Empty string in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
@@ -38,6 +38,6 @@ int(1234)
|
||||
bool(true)
|
||||
string(4) "none"
|
||||
|
||||
Warning: mb_substitute_character(): Unknown character. in %s on line %d
|
||||
Warning: mb_substitute_character(): Unknown character in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -123,7 +123,7 @@ fclose($fp);
|
||||
*** Testing mb_substitute_character() : usage variation ***
|
||||
|
||||
--int 0--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--int 1--
|
||||
@@ -133,30 +133,30 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
--int -12345--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--float 10.5--
|
||||
bool(true)
|
||||
|
||||
--float -10.5--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--float 12.3456789000e10--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--float -12.3456789000e10--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--float .5--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty array--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--int indexed array--
|
||||
@@ -169,25 +169,25 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
--uppercase NULL--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase null--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--lowercase true--
|
||||
bool(true)
|
||||
|
||||
--lowercase false--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--uppercase TRUE--
|
||||
bool(true)
|
||||
|
||||
--uppercase FALSE--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--empty string DQ--
|
||||
@@ -197,19 +197,19 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
--string DQ--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--string SQ--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--mixed case string--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--heredoc--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--instance of classWithToString--
|
||||
@@ -221,11 +221,11 @@ Error: 8 - Object of class classWithoutToString could not be converted to int, %
|
||||
bool(true)
|
||||
|
||||
--undefined var--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
|
||||
--unset var--
|
||||
Error: 2 - mb_substitute_character(): Unknown character., %s(%d)
|
||||
Error: 2 - mb_substitute_character(): Unknown character, %s(%d)
|
||||
bool(false)
|
||||
===DONE===
|
||||
|
||||
@@ -35,5 +35,5 @@ var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
|
||||
string(14) "3f3f3f3f3f3f3f"
|
||||
string(14) "42424242424242"
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(14) "3f3f3f3f3f3f3f"
|
||||
===DONE===
|
||||
@@ -336,7 +336,9 @@ ordered_range_insert(ac_uint4 c, char *name, int len)
|
||||
(len == 3 &&
|
||||
(memcmp(name, "NSM", 3) == 0 || memcmp(name, "PDF", 3) == 0 ||
|
||||
memcmp(name, "LRE", 3) == 0 || memcmp(name, "LRO", 3) == 0 ||
|
||||
memcmp(name, "RLE", 3) == 0 || memcmp(name, "RLO", 3) == 0))) {
|
||||
memcmp(name, "RLE", 3) == 0 || memcmp(name, "RLO", 3) == 0 ||
|
||||
memcmp(name, "LRI", 3) == 0 || memcmp(name, "RLI", 3) == 0 ||
|
||||
memcmp(name, "FSI", 3) == 0 || memcmp(name, "PDI", 3) == 0))) {
|
||||
/*
|
||||
* Mark all of these as Other Neutral to preserve compatibility with
|
||||
* older versions.
|
||||
@@ -350,8 +352,10 @@ ordered_range_insert(ac_uint4 c, char *name, int len)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == NUMPROPS)
|
||||
return;
|
||||
if (i == NUMPROPS) {
|
||||
printf("Unknown property %s\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Have a match, so insert the code in order.
|
||||
@@ -539,6 +543,10 @@ add_title(ac_uint4 code)
|
||||
*/
|
||||
cases[2] = code;
|
||||
|
||||
/* If lower/upper case does not exist, stay the same */
|
||||
if (!cases[0]) cases[0] = code;
|
||||
if (!cases[1]) cases[1] = code;
|
||||
|
||||
if (title_used == title_size) {
|
||||
if (title_size == 0)
|
||||
title = (_case_t *) malloc(sizeof(_case_t) << 3);
|
||||
@@ -825,7 +833,9 @@ read_cdata(FILE *in)
|
||||
|
||||
lineno = skip = 0;
|
||||
while (fgets(line, sizeof(line), in)) {
|
||||
if( (s=strchr(line, '\n')) ) *s = '\0';
|
||||
int is_title = 0;
|
||||
|
||||
if( (s=strchr(line, '\n')) ) *s = '\0';
|
||||
lineno++;
|
||||
|
||||
/*
|
||||
@@ -968,6 +978,10 @@ read_cdata(FILE *in)
|
||||
|
||||
ordered_range_insert(code, s, e - s);
|
||||
|
||||
if (e - s == 2 && s[0] == 'L' && s[1] == 't') {
|
||||
is_title = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Locate the combining class code.
|
||||
*/
|
||||
@@ -1112,7 +1126,7 @@ read_cdata(FILE *in)
|
||||
if (*s == ';')
|
||||
s++;
|
||||
}
|
||||
if (cases[0] && cases[1])
|
||||
if (is_title)
|
||||
/*
|
||||
* Add the upper and lower mappings for a title case character.
|
||||
*/
|
||||
@@ -1442,7 +1456,7 @@ write_cdata(char *opath)
|
||||
" * LowerIndex = _uccase_len[0]\n"
|
||||
" * TitleIndex = LowerIndex + _uccase_len[1] */\n\n");
|
||||
fprintf(out, PREF "unsigned short _uccase_len[2] = {%ld, %ld};\n\n",
|
||||
(long) upper_used * 3, (long) lower_used * 3);
|
||||
(long) upper_used, (long) lower_used);
|
||||
fprintf(out, PREF "unsigned int _uccase_map[] = {");
|
||||
|
||||
if (upper_used > 0)
|
||||
|
||||
@@ -1152,7 +1152,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
{
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
MYSQL_ROW row;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
MYSQL_FIELD *fields;
|
||||
zend_ulong *field_len;
|
||||
|
||||
@@ -1166,8 +1166,9 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
|
||||
array_init(return_value);
|
||||
field_len = mysql_fetch_lengths(result);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
if (row[i]) {
|
||||
zval res;
|
||||
|
||||
@@ -1247,6 +1248,10 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
||||
php_error_docref(NULL, E_WARNING, "Could not find class '%s'", ZSTR_VAL(class_name));
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
|
||||
zend_throw_error(NULL, "Class '%s' cannot be instantiated", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
fetchtype = MYSQLI_ASSOC;
|
||||
} else {
|
||||
if (override_flags) {
|
||||
|
||||
@@ -1210,7 +1210,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
zval *mysql_result;
|
||||
zval obj;
|
||||
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
|
||||
return;
|
||||
@@ -1219,8 +1219,9 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
const MYSQL_FIELD *field = mysql_fetch_field_direct(result, i);
|
||||
|
||||
object_init(&obj);
|
||||
@@ -1266,7 +1267,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
const size_t *ret;
|
||||
#else
|
||||
@@ -1284,8 +1285,9 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
add_index_long(return_value, i, ret[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysqli = new mysqli("$host:$port", $user, $passwd, $db);
|
||||
abstract class test {
|
||||
public $a;
|
||||
}
|
||||
$mysqli->query("SELECT 1 as a")->fetch_object("test");
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class 'test' cannot be instantiated in %sbug74968.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug74968.php(%d): mysqli_result->fetch_object('test')
|
||||
#1 {main}
|
||||
thrown in %sbug74968.php on line %d
|
||||
@@ -9,7 +9,7 @@ require_once('skipifconnectfailure.inc');
|
||||
require_once('connect.inc');
|
||||
if (!$IS_MYSQLND)
|
||||
die("skip Test for mysqlnd only");
|
||||
<?php require_once('skipifemb.inc'); ?>
|
||||
require_once('skipifemb.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once('connect.inc');
|
||||
|
||||