Compare commits

...
115 Commits
Author SHA1 Message Date
Anatol Belski 532aa2d2ae Set versions 2017-11-21 11:12:03 +01:00
Derick Rethans 30aeba2c33 Fixed ext/date tests due to changes in Olson database
(cherry picked from commit ca0bcf535c)
2017-11-07 12:45:01 +01:00
Anatol Belski 1bf53c4d90 Set versions 2017-11-07 10:28:45 +01:00
Anatol Belski c3be49e07d Update libs_version.txt 2017-11-02 22:41:12 +01:00
Nikita Popov d88ef8d7e1 Fix ext/soap/tests/bug69137.phpt
Switch to example.org. Also mark it as an online test.
2017-11-02 20:56:03 +01:00
Anatol Belski dbfa0140ae Sync and fix tests for ICU 60.1 compat 2017-11-02 12:37:04 +01:00
Anatol Belski f5358c0e23 Yet one /nologo 2017-11-02 09:21:22 +01:00
Anatol Belski 8a3e2a6b14 Fix year 2017-10-31 10:25:15 +01:00
Anatol Belski 164167f3da Add /nologo 2017-10-31 10:24:34 +01:00
Anatol Belski 68c500421c Add missing ICU version check 2017-10-30 18:15:26 +01:00
Jakub Zelenka fc169d2133 Prevent leaking x509 and csr resources if it is not requested
All functions using php_openssl_x509_from_zval or php_openssl_csr_from_zval
with makeresource equal to 0 do not deref the resource which means there
is a leak till the end of the request. This can cause issues for long
running apps. It is a generic solution for bug #75363 which also covers
other functions.
2017-10-30 16:40:56 +00:00
Jakub Zelenka d8ccffa79a Extend and speed up pkey export tests 2017-10-30 16:40:56 +00:00
Jakub Zelenka e78e839e53 Rewrite openssl_csr_get_subject test to improve coverage 2017-10-30 16:40:56 +00:00
Jakub Zelenka 528aa540b4 Add openssl_csr_get_public_key test 2017-10-30 16:40:56 +00:00
Jakub Zelenka 548798818b Extend openssl_pkcs7_* tests to cover resource cert 2017-10-30 16:40:56 +00:00
Jakub Zelenka 55d92413b9 Fix cleaning tmp output file in openssl_csr_export_to_file test 2017-10-30 16:40:56 +00:00
Jelle van der Waa 5812f7a8d3 openssl: add basic openssl_csr_export_to_file tests
Add a basic test for openssl_csr_export_to_file.
2017-10-30 16:40:56 +00:00
Jakub Zelenka 628a52d365 Extend openssl_csr_sign test to cover cert resource 2017-10-30 16:40:56 +00:00
Jakub Zelenka 80191eebec Set different invalid path in openssl_pkcs12_export so it is more unlikely to exist 2017-10-30 16:40:55 +00:00
Jakub Zelenka cd66aad141 Extend openssl_x509_parse to cover cert resource 2017-10-30 16:40:55 +00:00
Jakub Zelenka c1d98588a2 Rename and test resource cert in openssl_x509_checkpurpose test 2017-10-30 16:40:55 +00:00
Jakub Zelenka d23d4fd61b Extend openssl_x509_check_private_key to test resource cert 2017-10-30 16:40:55 +00:00
Jakub Zelenka be0758b75a Extend openssl_x509_fingerprint test to cover resource cert with sha1 2017-10-30 16:40:55 +00:00
Joe Watkins cfa885830a Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Yet one attempt to mitigate the unzip error on AppVeyor
  Ensure SDK is checked out before asking for version
  Fix fetching the SDK version
  Fix SDK version comparison and add more verbosity
  Don't use the cache dependency, SDK version is handled in script
  Remove status check on the SDK repo and add version check
  Catch with the latest AppVeyor unzip errors
2017-10-30 14:16:16 +00:00
Fabien Villepinte a308000ff2 Fix bug #75464 Wrong reflection on SoapClient::__setSoapHeaders 2017-10-30 14:13:05 +00:00
Anatol Belski 7ea44da104 Yet one attempt to mitigate the unzip error on AppVeyor 2017-10-30 12:16:53 +01:00
Anatol Belski e305e8fb7a Ensure SDK is checked out before asking for version 2017-10-30 12:07:27 +01:00
Anatol Belski 7bf2947016 Fix fetching the SDK version 2017-10-30 11:28:32 +01:00
Anatol Belski c6e8c2bc9f Fix SDK version comparison and add more verbosity 2017-10-30 10:53:12 +01:00
Anatol Belski 591e811a35 Don't use the cache dependency, SDK version is handled in script 2017-10-30 10:34:11 +01:00
Anatol Belski bc410c2609 Remove status check on the SDK repo and add version check
If Appveyor fails to unzip, .git would be in an arbitrary state anyway.
Thus this check doesn't help. For the version check - rely on the branch
naming scheme in the SDK.
2017-10-30 10:14:05 +01:00
Anatol Belski 741efa7807 Catch with the latest AppVeyor unzip errors 2017-10-30 08:42:59 +01:00
Fabien Villepinte e6aea3dc78 Fix bug #75453 Incorrect reflection on ibase_connect and ibase_pconnect 2017-10-30 06:55:00 +00:00
Anatol Belski 123b1d79eb Re-enable AppVeyor cache 2017-10-29 10:08:31 +01:00
Joe Watkins 59d413ceb8 make sure run-tests reports exit status upon prerequisite error 2017-10-29 04:37:21 +00:00
Fabien Villepinte 938f256ed9 Fix bug #75434 Wrong reflection for mysqli_fetch_all function 2017-10-28 12:57:25 +02:00
Fabien Villepinte 51ea2cfbe1 Fix bug #75307 Wrong reflection for openssl_open function 2017-10-27 16:06:01 +01:00
Anatol Belski 15a71fe045 Skip test on PostgreSQL 10
The 42P18 error is not produced by the server anymore.
2017-10-27 16:19:42 +02:00
Anatol Belski 24b1bb0abd Fix test compat for PostgreSQL 10 2017-10-27 14:58:43 +02:00
Anatol Belski 10dc1950f7 Apply upstream patch for CVE-2017-14107 2017-10-27 13:20:15 +02:00
Anatol Belski f0a42d9fe4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Backport and apply upstream patch for CVE-2017-14107
2017-10-27 13:18:41 +02:00
Anatol Belski f6e8ce8121 Backport and apply upstream patch for CVE-2017-14107 2017-10-27 13:16:56 +02:00
Anatol Belski 9eb6f86765 Binary SDK 2.0.12 stable 2017-10-26 21:25:08 +02:00
Dmitry Stogov 98eee90734 Fixed indirect modification of magic ArrayAccess method arguments 2017-10-26 16:03:42 +03:00
Dmitry Stogov 502cfddf28 Backport tests 2017-10-26 14:12:08 +03:00
Dmitry Stogov bc59289b7a Fixed indirect modification of magic method arguments. 2017-10-26 13:05:23 +03:00
Xinchen Hui eaeccc1d99 Fixed test 2017-10-26 10:23:43 +08:00
Xinchen Hui d2047503cb Fixed bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS) 2017-10-26 10:07:08 +08:00
Fabien Villepinte 578ba71b3b Fix typo in comments 2017-10-25 20:59:40 +01:00
Fabien Villepinte e763a1cdc7 Fix the SKIPIF part in /ext/gd/tests/bug75437.phpt 2017-10-25 14:39:38 +02:00
Fabien Villepinte 0fbb9f343f Fix bug #75437 Wrong reflection on imagewebp 2017-10-25 12:54:05 +02:00
Ferenc Kovacs 9fbf13a496 Merge branch 'PHP-5.6' into PHP-7.0 2017-10-25 03:39:34 +02:00
Ferenc Kovacs f600785f65 5.6.33 is next 2017-10-25 03:36:30 +02:00
Ferenc Kovacs b53fb886a4 use trusty explicitly 2017-10-25 03:14:51 +02:00
Ferenc Kovacs 6125ce9d33 Merge branch 'PHP-5.6' into PHP-7.0 2017-10-25 03:13:40 +02:00
Rasmus Lerdorf ad7ed6fe21 These tests all assume that IPV6 is available. 2017-10-25 02:21:16 +02:00
Ferenc Kovacs 787e3a1ee4 fix the travis build for PHP-5.6 using precise instead of trusty 2017-10-25 01:51:48 +02:00
Ferenc Kovacs 9839d3a953 fix the travis build for PHP-5.6 using precise instead of trusty 2017-10-25 01:47:50 +02:00
Anatol Belski e19bf29b53 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Parametrize the expected value to avoid platform false positives
2017-10-24 18:36:56 +02:00
Anatol Belski 45ac5edbd9 Parametrize the expected value to avoid platform false positives 2017-10-24 18:33:21 +02:00
Sara Golemon 68e27b0763 Decref default_link when clearing 2017-10-24 11:37:59 -04:00
Christoph M. Becker 22c487616f Fixed bug #65148 (imagerotate may alter image dimensions)
We apply the respective patches from external libgd, work around the
still missing `gdImageClone()`, and fix the special cased rotation
routines according to Pierre's patch
(https://gist.github.com/pierrejoye/59d72385ed1888cf8894a7ed437235ae).

We also cater to bug73272.phpt whose result obviously changes a bit.
2017-10-24 17:02:56 +02:00
Derick Rethans 8e3260376c Update timezonemap.h, which needs to match the bundled TZ db 2017-10-24 14:55:13 +01:00
Anatol Belski 75d0ba5179 [ci skip] update NEWS 2017-10-24 14:18:59 +02:00
Anatol Belski fadcfc8149 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  [ci skip] update NEWS
2017-10-24 14:17:21 +02:00
Anatol Belski 7d06a5c89f [ci skip] update NEWS 2017-10-24 14:16:54 +02:00
Anatol Belski 968c8fc0d5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72535 arcfour encryption stream filter crashes php
2017-10-24 14:04:08 +02:00
Anatol Belski 37acebcc8c Fixed bug #72535 arcfour encryption stream filter crashes php 2017-10-24 13:59:18 +02:00
Anatol Belski 5efbcd1882 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian()
  Apply upstream patch for CVE-2016-1283
2017-10-24 13:38:48 +02:00
Anatol Belski a7815e63bd Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian() 2017-10-24 11:28:17 +02:00
Anatol Belski d37658be6c Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636

(cherry picked from commit d11fceab15)
2017-10-24 11:10:11 +02:00
Sara Golemon 9fca585488 NEWS entry for pg_close() fix 2017-10-23 14:55:32 -04:00
Sara Golemon a645af4456 Bugfix#75419 Fix clearing of default link during pg_close() 2017-10-23 14:44:00 -04:00
Derick Rethans b2dfcb30eb Updated to version 2017.3 (2017c) 2017-10-23 17:31:20 +01:00
Anatol Belski 1cb2079d6c Fix memory leak 2017-10-23 15:26:08 +02:00
Anatol Belski 9f00e26008 Renaming cache folder is not a solution, too. Disable cache for now. 2017-10-23 07:13:00 +02:00
Anatol Belski c9a14b3aee Revert "Rename build cache folder and separate sdk"
This reverts commit 58dd892156.
2017-10-23 07:12:33 +02:00
Anatol Belski 58dd892156 Rename build cache folder and separate sdk 2017-10-23 07:08:45 +02:00
Anatol Belski eead6bf97a Revert "Invalidate the whole cache when .appveyor.yml was changed"
This reverts commit 25d40602cb.
2017-10-23 07:05:48 +02:00
Anatol Belski 25d40602cb Invalidate the whole cache when .appveyor.yml was changed 2017-10-23 07:00:36 +02:00
Jakub Zelenka 34ed75fab7 Fix clean up for openssl_pkcs12_export_to_file_basic 2017-10-22 18:54:15 +01:00
Jelle van der Waa 314bef5d03 openssl: Fix openssl_pkcs12_export extracerts test
Fix the openssl_pkcs12_export testcase for extracerts, the 'extracerts'
option needs to be the key of the certificate value otherwise
openssl_pkcs12_export will ignore it.
2017-10-22 18:53:30 +01:00
Anatol Belski 1d781fbdb1 With ICU 58+, set the default restriction level to high
Further experiments show, that CJK scripts should be ok. If there are
any issues, the moderate level can still be set later.
2017-10-21 17:21:41 +02:00
Anatol Belski 44b3bc847b Reenable AppVeyor cache 2017-10-21 11:59:22 +02:00
Anatol Belski 0b71ae7a15 Disable AppVeyor cache to unlock build 2017-10-21 10:49:20 +02:00
Anatol Belski 5d85d967bd Rework these new tests to match with diffs in ICU 58, 59 and upcoming 60 2017-10-21 10:29:04 +02:00
Anatol Belski ede8cee9e6 [ci skip] Update NEWS 2017-10-20 20:46:42 +02:00
Anatol Belski f95063647c Fixed bug #73655 Spoofchecker::isSuspicious behavior change due to upstream changes
There are significant changes in the spoof checking reflecting
http://www.unicode.org/reports/tr39/tr39-15.html and relying on the
restriction levels. ICU 58+ removes WSC and MSC handling and otherwise
undergoes big changes in both code and data areas. Keep up with the
basic points for now, as we need to move forward and provide an
acceptable experience to PHP users linking to a newer ICU. The most
distros ATM don't provide ICU > 57.1, though. We'll need for sure to
keep up with the BC breach in ICU 58+ in possible further aspects.
2017-10-20 19:23:32 +02:00
Anatol Belski 2198d38cbc Add test for newer ICU version 2017-10-20 19:02:42 +02:00
Anatol Belski e02c41fc72 Further test fixes for ICU >= 58 2017-10-20 18:39:46 +02:00
Anatol Belski 7240d99838 Fix version checks in tests 2017-10-20 15:23:09 +02:00
Anatol Belski 877e0b04bc Sync some tests for compat with ICU 58.1+ 2017-10-20 13:55:32 +02:00
Anatol Belski 9071ff5c87 Add skip for incompatible ICU version 2017-10-20 11:27:54 +02:00
Nester 80c3b078b8 Fixed #75317 - UConverter::setDestinationEncoding changes source instead of destinatination 2017-10-19 12:02:22 +01:00
Peter Kokot aa143515d6 Update .editorconfig with some more configs
Added support for .awk, .w32, .bat, .mk, .frag, .m4, .sh, .php, .phpt,
and Markdown files based on the current most used coding style in the
php-src repository.
2017-10-19 11:53:37 +01:00
Ryan Volz 4e85dd0346 Escape newline on curl config.m4 2017-10-19 11:39:54 +01:00
Anatol Belski 5f7707cc8a Move to php-sdk-2.0.0beta3 for Appveyor
Supposed to fix sporadic tool crashes on the test image
2017-10-18 17:45:33 +02:00
Anatol Belski d82805f097 Backport 7ff13badda into 7.0+ 2017-10-18 16:02:56 +02:00
Anatol Belski 9891f11f84 One more folder to delete in AppVeyor image 2017-10-17 15:32:47 +02:00
Tianfang Yang f955cff54c Fixed valgrind issue 2017-10-16 19:20:24 -04:00
Tianfang Yang aad4544e95 Fixed valgrind issue 2017-10-16 19:16:30 -04:00
Anatol Belski 7778106f40 Move to next binary SDK version for AppVeyor 2017-10-16 18:05:56 +02:00
Dmitry Stogov 8bfe748fb0 Prevent crash on ext/pdo_mysql/tests/bug_39858.phpt when built with libmysql 2017-10-16 19:00:12 +03:00
Jakub Zelenka 999fe36d40 Properly fix #75363 and address some other leaks with cert 2017-10-15 20:25:58 +01:00
Jelle van der Waa 5acb8381b2 Fixed bug #53070 (enchant_broker_get_path crashes if no path is set)
enchant_broker_get_dict_path segfaults when the dict path is not setup,
instead of segfaulting return false instead.
2017-10-15 13:57:44 +02:00
Christoph M. Becker fb09021432 Fixed bug #75365 (Enchant still reports version 1.1.0)
Since Enchant is bundled, we make `PHP_ENCHANT_VERSION` an alias of
`PHP_VERSION` and also drop the rather meaningless revision hash from
the PHP info.
2017-10-15 13:19:17 +02:00
Xinchen Hui 816758eda2 Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown function) 2017-10-15 10:28:28 +08:00
Dmitry Stogov 397f5cb687 Fixed bug #75368 (mmap/munmap trashing on unlucky allocations) 2017-10-13 13:56:06 +03:00
Bob Weinand a55af1e271 Fixed bug #75363 (openssl_x509_parse leaks memory) 2017-10-12 12:30:20 +02:00
Anatol Belski 23e97b0222 It looks like i should've taken joint response on ext/fileinfo long ago 2017-10-11 22:21:34 +02:00
Anatol Belski d432bdb4ab Put php-sdk-2.0.12beta1 for AppVeyor
Quite some tool upgrades there, especially re2c 1.0.2
2017-10-11 20:27:27 +02:00
Christoph M. Becker 787bf7eaf7 Merge branch 'pull-request/2798' into PHP-7.0
* pull-request/2798:
  Fix Bug #75299 Wrong reflection on inflate_init and inflate_add
2017-10-11 17:28:30 +02:00
Christoph M. Becker b497b6edf9 Merge branch 'pull-request/2799' into PHP-7.0
* pull-request/2799:
  Use PHP_VERSION for exif
2017-10-11 14:42:46 +02:00
Peter Kokot 74124de048 Use PHP_VERSION for exif 2017-10-04 23:25:36 +02:00
Fabien Villepinte 9d9873b3b5 Fix Bug #75299 Wrong reflection on inflate_init and inflate_add 2017-10-01 11:27:16 +02:00
117 changed files with 5238 additions and 2980 deletions

No files matched your search

+1 -2
View File
@@ -18,13 +18,12 @@ clone_depth: 64
cache:
- c:\build-cache
- c:\build-cache\sdk -> .appveyor.yml
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.11
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.12
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
+25 -6
View File
@@ -1,16 +1,35 @@
; http://editorconfig.org/
# http://editorconfig.org/
root = true
[*.{c,h}]
charset = UTF-8
end_of_line = LF
[*.{c,h,awk,w32,bat,mk,frag}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.yml]
[*.{php,phpt}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yml,m4,sh}]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = false
insert_final_newline = true
+1
View File
@@ -1,3 +1,4 @@
dist: trusty
language: c
sudo: false
addons:
+62 -1
View File
@@ -1,8 +1,60 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017 PHP 7.0.26
23 Nov 2017 PHP 7.0.26
- Core:
. Fixed bug #75420 (Crash when modifing property name in __isset for
BP_VAR_IS). (Laruence)
. Fixed bug #75368 (mmap/munmap trashing on unlucky allocations). (Nikita,
Dmitry)
- CLI:
. Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown
function). (Laruence)
- Enchant:
. Fixed bug #53070 (enchant_broker_get_path crashes if no path is set). (jelle
van der Waa, cmb)
. Fixed bug #75365 (Enchant still reports version 1.1.0). (cmb)
- Exif:
. Fixed bug #75301 (Exif extension has built in revision version). (Peter
Kokot)
- GD:
. Fixed bug #65148 (imagerotate may alter image dimensions). (cmb)
. Fixed bug #75437 (Wrong reflection on imagewebp). (Fabien Villepinte)
- intl:
. Fixed bug #75317 (UConverter::setDestinationEncoding changes source instead
of destination). (andrewnester)
- interbase:
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
- Mysqli:
. Fixed bug #75434 (Wrong reflection for mysqli_fetch_all function). (Fabien
Villepinte)
- OCI8:
. Fixed valgrind issue. (Tianfang Yang)
- Opcache:
. Fixed bug #75373 (Warning Internal error: wrong size calculation). (Laruence, Dmitry)
- OpenSSL:
. Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)
- PGSQL:
. Fixed bug #75419 (Default link incorrectly cleared/linked by pg_close()). (Sara)
- SOAP:
. Fixed bug #75464 (Wrong reflection on SoapClient::__setSoapHeaders). (villfa)
- Zlib:
. Fixed bug #75299 (Wrong reflection on inflate_init and inflate_add). (Fabien
Villepinte)
26 Oct 2017 PHP 7.0.25
@@ -21,13 +73,22 @@ PHP NEWS
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
apache2handler). (mcarbonneaux)
- Date:
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
- Intl:
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
optional). (cmb)
- mcrypt:
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
- OCI8:
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
- PCRE:
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75420.1 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
var_dump($name);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75420.10 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump($obj[$name] ?? 12);
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(42)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.11 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj[$name]));
var_dump($name);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75420.12 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump(empty($obj[$name]));
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
bool(false)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.13 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump($obj[$name] ?? 12);
var_dump($obj);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.14 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj[$name]));
var_dump($obj);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.15 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { }
public function offsetGet($x) { }
public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
$obj[$name] = 1;
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.16 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { }
public function offsetGet($x) { }
public function offsetSet($x, $y) { $GLOBALS["obj"] = 24; var_dump($this); }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$obj[$name] = 1;
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.2 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump($obj->$name ?? 12);
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(42)
int(24)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75420.3 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj->$name));
var_dump($name);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.4 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump(empty($obj->$name));
?>
--EXPECT--
string(6) "foofoo"
bool(false)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #75420.5 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
public function __get($x) { var_dump($this); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(42)
int(24)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #75420.6 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
public function __get($x) { var_dump($this); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj->$name));
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
bool(false)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.7 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __set($x,$v) { $GLOBALS["name"] = 24; var_dump($x); }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
$obj->$name = 1;
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.8 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __set($x,$v) { $GLOBALS["obj"] = 24; var_dump($this); }
}
$obj = new Test;
$name = "foo";
$obj->$name = 1;
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.9 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump($obj[$name] ?? 12);
var_dump($name);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
?>
--EXPECT--
string(3) "foo"
int(42)
+19 -1
View File
@@ -267,6 +267,8 @@ struct _zend_mm_heap {
int peak_chunks_count; /* peak number of allocated chunks for current request */
int cached_chunks_count; /* number of cached chunks */
double avg_chunks_count; /* average number of chunks allocated per request */
int last_chunks_delete_boundary; /* numer of chunks after last deletion */
int last_chunks_delete_count; /* number of deletion over the last boundary */
#if ZEND_MM_CUSTOM
union {
struct {
@@ -1122,7 +1124,9 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
chunk->next->prev = chunk->prev;
chunk->prev->next = chunk->next;
heap->chunks_count--;
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1) {
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1
|| (heap->chunks_count == heap->last_chunks_delete_boundary
&& heap->last_chunks_delete_count >= 4)) {
/* delay deletion */
heap->cached_chunks_count++;
chunk->next = heap->cached_chunks;
@@ -1131,6 +1135,14 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size -= ZEND_MM_CHUNK_SIZE;
#endif
if (!heap->cached_chunks) {
if (heap->chunks_count != heap->last_chunks_delete_boundary) {
heap->last_chunks_delete_boundary = heap->chunks_count;
heap->last_chunks_delete_count = 0;
} else {
heap->last_chunks_delete_count++;
}
}
if (!heap->cached_chunks || chunk->num > heap->cached_chunks->num) {
zend_mm_chunk_free(heap, chunk, ZEND_MM_CHUNK_SIZE);
} else {
@@ -1864,6 +1876,8 @@ static zend_mm_heap *zend_mm_init(void)
heap->peak_chunks_count = 1;
heap->cached_chunks_count = 0;
heap->avg_chunks_count = 1.0;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
@@ -2279,6 +2293,8 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent)
p->map[0] = ZEND_MM_LRUN(ZEND_MM_FIRST_PAGE);
heap->chunks_count = 1;
heap->peak_chunks_count = 1;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
@@ -2811,6 +2827,8 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
heap->peak_chunks_count = 1;
heap->cached_chunks_count = 0;
heap->avg_chunks_count = 1.0;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
+60 -31
View File
@@ -507,9 +507,10 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
zval tmp_member, tmp_object;
zval *retval;
uint32_t property_offset;
zend_long *guard = NULL;
zobj = Z_OBJ_P(object);
@@ -542,12 +543,18 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
}
ZVAL_UNDEF(&tmp_object);
/* magic isset */
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
zval tmp_object, tmp_result;
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
zval tmp_result;
guard = zend_get_property_guard(zobj, Z_STR_P(member));
if (!((*guard) & IN_ISSET)) {
if (Z_TYPE(tmp_member) == IS_UNDEF) {
ZVAL_COPY(&tmp_member, member);
member = &tmp_member;
}
ZVAL_COPY(&tmp_object, object);
ZVAL_UNDEF(&tmp_result);
@@ -562,19 +569,20 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
}
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_result);
}
}
/* magic get */
if (zobj->ce->__get) {
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
if (guard == NULL) {
guard = zend_get_property_guard(zobj, Z_STR_P(member));
}
if (!((*guard) & IN_GET)) {
zval tmp_object;
/* have getter - try with it! */
ZVAL_COPY(&tmp_object, object);
if (Z_TYPE(tmp_object) == IS_UNDEF) {
ZVAL_COPY(&tmp_object, object);
}
*guard |= IN_GET; /* prevent circular getting */
zend_std_call_getter(&tmp_object, member, rv);
*guard &= ~IN_GET;
@@ -594,6 +602,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
zval_ptr_dtor(&tmp_object);
goto exit;
} else {
zval_ptr_dtor(&tmp_object);
if (Z_STRVAL_P(member)[0] == '\0') {
if (Z_STRLEN_P(member) == 0) {
zend_throw_error(NULL, "Cannot access empty property");
@@ -607,6 +616,9 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
}
}
}
zval_ptr_dtor(&tmp_object);
if ((type != BP_VAR_IS)) {
zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member));
}
@@ -722,34 +734,38 @@ exit:
zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
zval tmp_offset, tmp_object;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if (offset == NULL) {
/* [] construct */
ZVAL_NULL(&tmp);
offset = &tmp;
ZVAL_NULL(&tmp_offset);
} else {
SEPARATE_ARG_IF_REF(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
}
ZVAL_COPY(&tmp_object, object);
if (type == BP_VAR_IS) {
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", rv, &tmp_offset);
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
return NULL;
}
if (!i_zend_is_true(rv)) {
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
zval_ptr_dtor(rv);
return &EG(uninitialized_zval);
}
zval_ptr_dtor(rv);
}
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", rv, &tmp_offset);
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
if (UNEXPECTED(!EG(exception))) {
@@ -768,17 +784,19 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
zval tmp_offset, tmp_object;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if (!offset) {
ZVAL_NULL(&tmp);
offset = &tmp;
ZVAL_NULL(&tmp_offset);
} else {
SEPARATE_ARG_IF_REF(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
}
zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value);
zval_ptr_dtor(offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_2_params(&tmp_object, ce, NULL, "offsetset", NULL, &tmp_offset, value);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
}
@@ -788,17 +806,19 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /*
static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval retval;
zval retval, tmp_offset, tmp_object;
int result;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", &retval, offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (check_empty && result && EXPECTED(!EG(exception))) {
zend_call_method_with_1_params(object, ce, NULL, "offsetget", &retval, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
@@ -807,7 +827,8 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /
} else {
result = 0;
}
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
return 0;
@@ -969,11 +990,15 @@ exit:
static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp_offset, tmp_object;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
zval_ptr_dtor(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetunset", NULL, &tmp_offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
}
@@ -1507,6 +1532,10 @@ found:
zval tmp_object;
/* have issetter - try with it! */
if (Z_TYPE(tmp_member) == IS_UNDEF) {
ZVAL_COPY(&tmp_member, member);
member = &tmp_member;
}
ZVAL_COPY(&tmp_object, object);
(*guard) |= IN_ISSET; /* prevent circular getting */
zend_std_call_issetter(&tmp_object, member, &rv);
+11 -2
View File
@@ -2,6 +2,7 @@
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
@@ -13,17 +14,25 @@ if not exist "%PHP_BUILD_OBJ_DIR%" (
mkdir "%PHP_BUILD_OBJ_DIR%"
)
if not exist "%SDK_RUNNER%" (
if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
)
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
echo Cloning remote SDK repository
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
) else (
)
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
echo Got SDK version %GOT_SDK_VER%
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
echo Switching to the configured SDK version %SDK_BRANCH:~8%
echo Fetching remote SDK repository
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
echo Checkout SDK repository branch
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
)
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
if not exist "%SDK_RUNNER%" (
echo "%SDK_RUNNER%" doesn't exist
exit /b 3
+2
View File
@@ -8,6 +8,8 @@ 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
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
cd /D %APPVEYOR_BUILD_FOLDER%
if %errorlevel% neq 0 exit /b 3
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=26
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+2 -2
View File
@@ -33,8 +33,8 @@ if test "$PHP_CURL" != "no"; then
fi
if test -z "$CURL_DIR"; then
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/)
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -dnl
easy.h should be in <curl-dir>/include/curl/)
fi
CURL_CONFIG="curl-config"
+2424 -837
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -917,8 +917,8 @@ isoweek = year4 "-"? "W" weekofyear;
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
firstdayof = 'first day of';
lastdayof = 'last day of';
backof = 'back of ' hour24 space? meridian?;
frontof = 'front of ' hour24 space? meridian?;
backof = 'back of ' hour24 (space? meridian)?;
frontof = 'front of ' hour24 (space? meridian)?;
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
+1009 -1078
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+12 -21
View File
@@ -8,17 +8,8 @@ date_default_timezone_set('UTC');
echo "Done\n";
?>
--EXPECTF--
array(6) {
array(5) {
[0]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(16) "Antarctica/Troll"
}
[1]=>
array(3) {
["dst"]=>
bool(false)
@@ -27,7 +18,7 @@ array(6) {
["timezone_id"]=>
string(13) "Etc/Universal"
}
[2]=>
[1]=>
array(3) {
["dst"]=>
bool(false)
@@ -36,7 +27,7 @@ array(6) {
["timezone_id"]=>
string(7) "Etc/UTC"
}
[3]=>
[2]=>
array(3) {
["dst"]=>
bool(false)
@@ -45,6 +36,15 @@ array(6) {
["timezone_id"]=>
string(8) "Etc/Zulu"
}
[3]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(3) "UTC"
}
[4]=>
array(3) {
["dst"]=>
@@ -54,14 +54,5 @@ array(6) {
["timezone_id"]=>
string(3) "UTC"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(3) "UTC"
}
}
Done
+1 -23
View File
@@ -1,6 +1,5 @@
--TEST--
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone
public array DateTimeZone::getLocation ( void ) ;
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone public array DateTimeZone::getLocation ( void ) ;
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
--SKIPIF--
@@ -53,30 +52,9 @@ Array
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] =>
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] =>
)
@@ -29,15 +29,15 @@ string(5) "array"
int(%d)
-- Format a sample entry --
array(11) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
string(18) "Australia/Adelaide"
}
[1]=>
array(3) {
@@ -51,47 +51,47 @@ array(11) {
[2]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(16) "America/Eirunepe"
string(21) "Australia/Broken_Hill"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
string(16) "Australia/Darwin"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(11) "Brazil/Acre"
string(15) "Australia/North"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(13) "Asia/Jayapura"
string(15) "Australia/South"
}
[6]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
string(20) "Australia/Yancowinna"
}
[7]=>
array(3) {
@@ -100,7 +100,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(16) "Australia/Darwin"
string(21) "Australia/Broken_Hill"
}
[8]=>
array(3) {
@@ -109,7 +109,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/North"
string(16) "Australia/Darwin"
}
[9]=>
array(3) {
@@ -118,9 +118,18 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
string(15) "Australia/North"
}
[10]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
+1 -1
View File
@@ -5,7 +5,7 @@ date.timezone=Asia/Singapore
--FILE--
<?php
print strtotime('2008-05-23 00:00:00 SGT');
print strtotime('2008-05-23 00:00:00 +08');
print "\n";
print strtotime('2008-05-23 00:00:00');
+1 -1
View File
@@ -40,7 +40,7 @@ object(DateInterval)#%d (15) {
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(9)
int(%d)
["have_special_relative"]=>
int(0)
}
@@ -26,18 +26,18 @@ var_dump( $abbr["acst"] );
--EXPECTF--
*** Testing timezone_abbreviations_list() : basic functionality ***
string(5) "array"
int(%d)
int(142)
-- Format a sample entry --
array(11) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
string(18) "Australia/Adelaide"
}
[1]=>
array(3) {
@@ -51,47 +51,47 @@ array(11) {
[2]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(16) "America/Eirunepe"
string(21) "Australia/Broken_Hill"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
string(16) "Australia/Darwin"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(11) "Brazil/Acre"
string(15) "Australia/North"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(13) "Asia/Jayapura"
string(15) "Australia/South"
}
[6]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
string(20) "Australia/Yancowinna"
}
[7]=>
array(3) {
@@ -100,7 +100,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(16) "Australia/Darwin"
string(21) "Australia/Broken_Hill"
}
[8]=>
array(3) {
@@ -109,7 +109,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/North"
string(16) "Australia/Darwin"
}
[9]=>
array(3) {
@@ -118,9 +118,18 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
string(15) "Australia/North"
}
[10]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
@@ -24,11 +24,6 @@ var_dump( timezone_name_from_abbr("EDT") );
echo "-- Lookup with name and offset--\n";
var_dump( timezone_name_from_abbr("ADT", -10800) );
var_dump( timezone_name_from_abbr("ADT", 14400) );
var_dump( timezone_name_from_abbr("AKTT", 14400) );
var_dump( timezone_name_from_abbr("aktt", 18000) );
var_dump( timezone_name_from_abbr("Aktt", 21600) );
var_dump( timezone_name_from_abbr("AMST", -10800) );
var_dump( timezone_name_from_abbr("amst", 180000) );
echo "-- Tests without valid name - uses gmtOffset and isdst to find match --\n";
var_dump( timezone_name_from_abbr("", 3600, 1) );
@@ -51,12 +46,7 @@ string(13) "Europe/Berlin"
string(16) "America/New_York"
-- Lookup with name and offset--
string(15) "America/Halifax"
string(12) "Asia/Baghdad"
string(11) "Asia/Aqtobe"
string(11) "Asia/Aqtobe"
string(11) "Asia/Aqtobe"
string(17) "America/Boa_Vista"
string(12) "Asia/Yerevan"
string(15) "America/Halifax"
-- Tests without valid name - uses gmtOffset and isdst to find match --
string(13) "Europe/London"
string(17) "America/Sao_Paulo"
@@ -65,4 +55,4 @@ string(15) "America/Halifax"
-- Tests with invalid offsets --
bool(false)
bool(false)
===DONE===
===DONE===
+5 -1
View File
@@ -323,7 +323,6 @@ PHP_MINFO_FUNCTION(enchant)
#elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
#endif
php_info_print_table_row(2, "Revision", "$Id$");
php_info_print_table_end();
php_info_print_table_start();
@@ -483,6 +482,11 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
RETURN_FALSE;
}
if (value == NULL) {
php_error_docref(NULL, E_WARNING, "dict_path not set");
RETURN_FALSE;
}
RETURN_STRING(value);
}
/* }}} */
+1 -1
View File
@@ -24,7 +24,7 @@
extern zend_module_entry enchant_module_entry;
#define phpext_enchant_ptr &enchant_module_entry
#define PHP_ENCHANT_VERSION "1.1.0"
#define PHP_ENCHANT_VERSION PHP_VERSION
#ifdef PHP_WIN32
#define PHP_ENCHANT_API __declspec(dllexport)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #53070 (enchant_broker_get_path crashes if no path is set)
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
?>
--FILE--
<?php
$broker = enchant_broker_init();
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_MYSPELL));
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_ISPELL));
?>
--EXPECTF--
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)
+1 -1
View File
@@ -22,7 +22,7 @@
#if HAVE_EXIF
#include "php_version.h"
#define PHP_EXIF_VERSION "1.4 $Id: 8bdc0c8f27c2c9dd1f7551f1f9fe3ab57a06a4b1 $"
#define PHP_EXIF_VERSION PHP_VERSION
extern zend_module_entry exif_module_entry;
#define phpext_exif_ptr &exif_module_entry
+1 -1
View File
@@ -1,2 +1,2 @@
fileinfo
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski
+1
View File
@@ -377,6 +377,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewebp, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, quality)
ZEND_END_ARG_INFO()
#endif
+65 -22
View File
@@ -1709,13 +1709,28 @@ gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, cons
return im_scaled;
}
static int gdRotatedImageSize(gdImagePtr src, const float angle, gdRectPtr bbox)
{
gdRect src_area;
double m[6];
gdAffineRotate(m, angle);
src_area.x = 0;
src_area.y = 0;
src_area.width = gdImageSX(src);
src_area.height = gdImageSY(src);
if (gdTransformAffineBoundingBox(&src_area, m, bbox) != GD_TRUE) {
return GD_FALSE;
}
return GD_TRUE;
}
gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, const int bgColor)
{
float _angle = ((float) (-degrees / 180.0f) * (float)M_PI);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1726,6 +1741,12 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
gdRect bbox;
int new_height, new_width;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
if (new_width == 0 || new_height == 0) {
return NULL;
@@ -1768,8 +1789,6 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
const int angle_rounded = (int)floor(degrees * 100);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1780,6 +1799,8 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
int new_width, new_height;
gdRect bbox;
const gdFixed f_slop_y = f_sin;
const gdFixed f_slop_x = f_cos;
@@ -1792,6 +1813,10 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
return NULL;
}
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (!dst) {
return NULL;
@@ -1831,8 +1856,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
float _angle = (float)((- degrees / 180.0f) * M_PI);
const unsigned int src_w = gdImageSX(src);
const unsigned int src_h = gdImageSY(src);
unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
unsigned int new_width, new_height;
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1844,6 +1868,12 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
unsigned int dst_offset_y = 0;
unsigned int src_offset_x, src_offset_y;
gdImagePtr dst;
gdRect bbox;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
@@ -1863,7 +1893,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
const unsigned int m = gd_fxtoi(f_m);
const unsigned int n = gd_fxtoi(f_n);
if ((m > 0) && (m < src_h - 1) && (n > 0) && (n < src_w - 1)) {
if ((m >= 0) && (m < src_h - 1) && (n >= 0) && (n < src_w - 1)) {
const gdFixed f_f = f_m - gd_itofx(m);
const gdFixed f_g = f_n - gd_itofx(n);
const gdFixed f_w1 = gd_mulfx(f_1-f_f, f_1-f_g);
@@ -1871,11 +1901,6 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
const gdFixed f_w3 = gd_mulfx(f_f, f_1-f_g);
const gdFixed f_w4 = gd_mulfx(f_f, f_g);
if (n < src_w - 1) {
src_offset_x = n + 1;
src_offset_y = m;
}
if (m < src_h-1) {
src_offset_x = n;
src_offset_y = m + 1;
@@ -1890,13 +1915,13 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
register int pixel2, pixel3, pixel4;
if (src_offset_y + 1 >= src_h) {
pixel2 = bgColor;
pixel3 = bgColor;
pixel4 = bgColor;
pixel2 = pixel1;
pixel3 = pixel1;
pixel4 = pixel1;
} else if (src_offset_x + 1 >= src_w) {
pixel2 = bgColor;
pixel3 = bgColor;
pixel4 = bgColor;
pixel2 = pixel1;
pixel3 = pixel1;
pixel4 = pixel1;
} else {
pixel2 = src->tpixels[src_offset_y][src_offset_x + 1];
pixel3 = src->tpixels[src_offset_y + 1][src_offset_x];
@@ -1946,8 +1971,7 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
const float _angle = (float)((- degrees / 180.0f) * M_PI);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
const unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
unsigned int new_width, new_height;
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1963,7 +1987,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
gdRect bbox;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
@@ -2206,8 +2234,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{
const int angle_rounded = (int)floor(angle * 100);
/* round to two decimals and keep the 100x multiplication to use it in the common square angles
case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for
slow animations, f.e. */
const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100);
if (bgcolor < 0) {
return NULL;
}
@@ -2224,6 +2255,18 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
/* no interpolation needed here */
switch (angle_rounded) {
case 0: {
gdImagePtr dst = gdImageCreateTrueColor(src->sx, src->sy);
if (dst == NULL) {
return NULL;
}
dst->transparent = src->transparent;
dst->saveAlphaFlag = 1;
dst->alphaBlendingFlag = gdEffectReplace;
gdImageCopy(dst, src, 0,0,0,0,src->sx,src->sy);
return dst;
}
case -27000:
case 9000:
return gdImageRotate90(src, 0);
+4 -1
View File
@@ -164,7 +164,10 @@ readwbmp (int (*getin) (void *in), void *in, Wbmp ** return_wbmp)
}
if (skipheader (getin, in))
return (-1);
{
gdFree (wbmp);
return (-1);
}
wbmp->width = getmbi (getin, in);
+179
View File
@@ -0,0 +1,179 @@
--TEST--
Bug #65148 (imagerotate may alter image dimensions)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension is not available');
?>
--FILE--
<?php
$interpolations = array(
'IMG_BELL' => IMG_BELL,
'IMG_BESSEL' => IMG_BESSEL,
'IMG_BICUBIC' => IMG_BICUBIC,
'IMG_BICUBIC_FIXED' => IMG_BICUBIC_FIXED,
'IMG_BILINEAR_FIXED' => IMG_BILINEAR_FIXED,
'IMG_BLACKMAN' => IMG_BLACKMAN,
'IMG_BOX' => IMG_BOX,
'IMG_BSPLINE' => IMG_BSPLINE,
'IMG_CATMULLROM' => IMG_CATMULLROM,
'IMG_GAUSSIAN' => IMG_GAUSSIAN,
'IMG_GENERALIZED_CUBIC' => IMG_GENERALIZED_CUBIC,
'IMG_HERMITE' => IMG_HERMITE,
'IMG_HAMMING' => IMG_HAMMING,
'IMG_HANNING' => IMG_HANNING,
'IMG_MITCHELL' => IMG_MITCHELL,
'IMG_POWER' => IMG_POWER,
'IMG_QUADRATIC' => IMG_QUADRATIC,
'IMG_SINC' => IMG_SINC,
'IMG_NEAREST_NEIGHBOUR' => IMG_NEAREST_NEIGHBOUR,
'IMG_WEIGHTED4' => IMG_WEIGHTED4,
'IMG_TRIANGLE' => IMG_TRIANGLE,
);
$img = imagecreate(40, 20);
$results = array();
foreach ($interpolations as $name => $interpolation) {
imagesetinterpolation($img, $interpolation);
$t = imagecolorallocatealpha($img, 0, 0, 0, 127);
$imgr = imagerotate($img, -5, $t);
$results[$name] = array('x' => imagesx($imgr), 'y' => imagesy($imgr));
imagedestroy($imgr);
}
imagedestroy($img);
print_r($results);
?>
===DONE===
--EXPECT--
Array
(
[IMG_BELL] => Array
(
[x] => 40
[y] => 23
)
[IMG_BESSEL] => Array
(
[x] => 40
[y] => 23
)
[IMG_BICUBIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_BICUBIC_FIXED] => Array
(
[x] => 40
[y] => 23
)
[IMG_BILINEAR_FIXED] => Array
(
[x] => 40
[y] => 23
)
[IMG_BLACKMAN] => Array
(
[x] => 40
[y] => 23
)
[IMG_BOX] => Array
(
[x] => 40
[y] => 23
)
[IMG_BSPLINE] => Array
(
[x] => 40
[y] => 23
)
[IMG_CATMULLROM] => Array
(
[x] => 40
[y] => 23
)
[IMG_GAUSSIAN] => Array
(
[x] => 40
[y] => 23
)
[IMG_GENERALIZED_CUBIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_HERMITE] => Array
(
[x] => 40
[y] => 23
)
[IMG_HAMMING] => Array
(
[x] => 40
[y] => 23
)
[IMG_HANNING] => Array
(
[x] => 40
[y] => 23
)
[IMG_MITCHELL] => Array
(
[x] => 40
[y] => 23
)
[IMG_POWER] => Array
(
[x] => 40
[y] => 23
)
[IMG_QUADRATIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_SINC] => Array
(
[x] => 40
[y] => 23
)
[IMG_NEAREST_NEIGHBOUR] => Array
(
[x] => 40
[y] => 23
)
[IMG_WEIGHTED4] => Array
(
[x] => 40
[y] => 23
)
[IMG_TRIANGLE] => Array
(
[x] => 40
[y] => 23
)
)
===DONE===
Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 741 B

+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75437 Wrong reflection on imagewebp
--SKIPIF--
<?php
if (!extension_loaded('reflection')) die('skip reflection not available');
if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) die("skip test requires GD 2.2.0 or higher");
if (!function_exists('imagewebp')) die('skip WebP support not available');
?>
--FILE--
<?php
$rf = new ReflectionFunction('imagewebp');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(3)
int(1)
===DONE===
+4 -4
View File
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_ibase_errcode, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 0)
ZEND_ARG_INFO(0, database)
ZEND_ARG_INFO(0, username)
ZEND_ARG_INFO(0, password)
@@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_connect, 0, 0, 1)
ZEND_ARG_INFO(0, role)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_pconnect, 0, 0, 0)
ZEND_ARG_INFO(0, database)
ZEND_ARG_INFO(0, username)
ZEND_ARG_INFO(0, password)
@@ -1030,7 +1030,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
}
/* }}} */
/* {{{ proto resource ibase_connect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
/* {{{ proto resource ibase_connect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
Open a connection to an InterBase database */
PHP_FUNCTION(ibase_connect)
{
@@ -1038,7 +1038,7 @@ PHP_FUNCTION(ibase_connect)
}
/* }}} */
/* {{{ proto resource ibase_pconnect(string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]])
/* {{{ proto resource ibase_pconnect([string database [, string username [, string password [, string charset [, int buffers [, int dialect [, string role]]]]]]])
Open a persistent connection to an InterBase database */
PHP_FUNCTION(ibase_pconnect)
{
+4 -4
View File
@@ -411,7 +411,7 @@ static zend_bool php_converter_set_encoding(php_converter_object *objval,
ZEND_BEGIN_ARG_INFO_EX(php_converter_set_encoding_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO();
static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PARAMETERS) {
static void php_converter_do_set_encoding(UConverter **pcnv, INTERNAL_FUNCTION_PARAMETERS) {
php_converter_object *objval = CONV_GET(getThis());
char *enc;
size_t enc_len;
@@ -423,21 +423,21 @@ static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PAR
}
intl_errors_reset(&objval->error);
RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len));
RETURN_BOOL(php_converter_set_encoding(objval, pcnv, enc, enc_len));
}
/* }}} */
/* {{{ proto bool UConverter::setSourceEncoding(string encoding) */
static PHP_METHOD(UConverter, setSourceEncoding) {
php_converter_object *objval = CONV_GET(getThis());
php_converter_do_set_encoding(objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU);
php_converter_do_set_encoding(&(objval->src), INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
/* {{{ proto bool UConverter::setDestinationEncoding(string encoding) */
static PHP_METHOD(UConverter, setDestinationEncoding) {
php_converter_object *objval = CONV_GET(getThis());
php_converter_do_set_encoding(objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
php_converter_do_set_encoding(&(objval->dest), INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@@ -78,4 +78,8 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
RETURN_FALSE; \
} \
#if U_ICU_VERSION_MAJOR_NUM >= 58
#define SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL USPOOF_HIGHLY_RESTRICTIVE
#endif
#endif // #ifndef SPOOFCHECKER_CLASS_H
@@ -43,12 +43,23 @@ PHP_METHOD(Spoofchecker, __construct)
co->uspoof = uspoof_open(SPOOFCHECKER_ERROR_CODE_P(co));
INTL_METHOD_CHECK_STATUS(co, "spoofchecker: unable to open ICU Spoof Checker");
#if U_ICU_VERSION_MAJOR_NUM >= 58
/* TODO save it into the object for further suspiction check comparison. */
/* ICU 58 removes WSC and MSC handling. However there are restriction
levels as defined in
http://www.unicode.org/reports/tr39/tr39-15.html#Restriction_Level_Detection
and the default is high restrictive. In further, we might want to utilize
uspoof_check2 APIs when it became stable, to use extended check result APIs.
Subsequent changes in the unicode security algos are to be watched.*/
uspoof_setRestrictionLevel(co->uspoof, SPOOFCHECKER_DEFAULT_RESTRICTION_LEVEL);
#else
/* Single-script enforcement is on by default. This fails for languages
like Japanese that legally use multiple scripts within a single word,
so we turn it off.
*/
checks = uspoof_getChecks(co->uspoof, SPOOFCHECKER_ERROR_CODE_P(co));
uspoof_setChecks(co->uspoof, checks & ~USPOOF_SINGLE_SCRIPT, SPOOFCHECKER_ERROR_CODE_P(co));
#endif
zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1,9 +1,11 @@
--TEST--
IntlBreakIterator::getPartsIterator(): basic test
IntlBreakIterator::getPartsIterator(): basic test, ICU <= 57.1
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -34,4 +36,4 @@ Array
[2] => bar
)
int(0)
==DONE==
==DONE==
@@ -0,0 +1,39 @@
--TEST--
IntlBreakIterator::getPartsIterator(): basic test, ICU >= 58.1
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU >= 58.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt');
$pi = $bi->getPartsIterator();
var_dump(get_class($pi));
print_r(iterator_to_array($pi));
$bi->setText("foo bar");
$pi = $bi->getPartsIterator();
var_dump(get_class($pi->getBreakIterator()));
print_r(iterator_to_array($pi));
var_dump($pi->getRuleStatus());
?>
==DONE==
--EXPECTF--
string(17) "IntlPartsIterator"
Array
(
)
string(26) "IntlRuleBasedBreakIterator"
Array
(
[0] => foo
[1] =>
[2] => bar
)
int(%d)
==DONE==
@@ -1,9 +1,11 @@
--TEST--
IntlBreakIterator::preceding(): basic test
IntlBreakIterator::preceding(): basic test, ICU <= 57.1
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '57.1') > 0) die('skip for ICU <= 57.1');
?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -21,4 +23,4 @@ var_dump($bi->preceding(-1));
int(4)
int(21)
int(0)
==DONE==
==DONE==
@@ -0,0 +1,25 @@
--TEST--
IntlBreakIterator::preceding(): basic test, ICU >= 58.1
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '57.1') <= 0) die('skip for ICU >= 58.1');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createWordInstance('pt');
$bi->setText('foo bar trans zoo bee');
var_dump($bi->preceding(5));
var_dump($bi->preceding(50));
var_dump($bi->preceding(-1));
?>
==DONE==
--EXPECTF--
int(4)
int(21)
int(%i)
==DONE==
+53
View File
@@ -0,0 +1,53 @@
--TEST--
Bug #75317 (UConverter::setDestinationEncoding changes source instead of destinatination)
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension is not available');
?>
--FILE--
<?php
$utf8 = UConverter::getAliases('utf-8')[0];
$utf16 = UConverter::getAliases('utf-16')[0];
$utf32 = UConverter::getAliases('utf-32')[0];
$latin1 = UConverter::getAliases('latin1')[0];
function printResult($actual, $expected) {
var_dump($actual === $expected ? true : "expected: $expected, actual: $actual");
}
// test default values
$c = new UConverter();
printResult($c->getDestinationEncoding(), $utf8);
printResult($c->getSourceEncoding(), $utf8);
// test constructor args
$c = new UConverter('utf-16', 'latin1');
printResult($c->getDestinationEncoding(), $utf16);
printResult($c->getSourceEncoding(), $latin1);
// test setters
var_dump($c->setDestinationEncoding('utf-8'));
var_dump($c->setSourceEncoding('utf-32'));
printResult($c->getDestinationEncoding(), $utf8);
printResult($c->getSourceEncoding(), $utf32);
// test invalid inputs dont change values
var_dump($c->setDestinationEncoding('foobar') === false);
var_dump($c->setSourceEncoding('foobar') === false);
printResult($c->getDestinationEncoding(), $utf8);
printResult($c->getSourceEncoding(), $utf32);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
@@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the calendar arg
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -0,0 +1,53 @@
--TEST--
IntlDateFormatter: several forms of the calendar arg
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
ini_set("date.timezone", 'Atlantic/Azores');
$ts = strtotime('2012-01-01 00:00:00 UTC');
$cal = new IntlGregorianCalendar('UTC', NULL);
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
echo $df->format($ts), "\n";
$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
echo $df->format($ts), "\n";
//override calendar's timezone
$cal = new IntlGregorianCalendar('UTC', NULL);
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
echo $df->format($ts), "\n";
//default calendar is gregorian
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
echo $df->format($ts), "\n";
//try now with traditional
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
echo $df->format($ts), "\n";
//the timezone can be overridden when not specifying a calendar
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
echo $df->format($ts), "\n";
$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
echo $df->format($ts), "\n";
?>
==DONE==
--EXPECTF--
domingo%S 1 de enero de 2012, 0:00:00 (%siempo %sniversal %sordinado)
domingo%S 8 de %safar de 1433, 0:00:00 (%siempo %sniversal %sordinado)
domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores)
sábado, 7 de %safar de 1433 AH, 23:00:00 (hora estándar de las Azores)
domingo%S 8 de %safar de 1433 AH, 0:00:00 (%siempo %sniversal %sordinado)
domingo%S 1 de enero de 2012, 0:00:00 (%siempo %sniversal %sordinado)
==DONE==
@@ -4,6 +4,7 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -0,0 +1,55 @@
--TEST--
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
ini_set("date.timezone", 'Atlantic/Azores');
$ts = strtotime('2012-01-01 00:00:00 UTC');
function d(IntlDateFormatter $df) {
global $ts;
echo $df->format($ts), "\n";
var_dump($df->getCalendar(),
$df->getCalendarObject()->getType(),
$df->getCalendarObject()->getTimeZone()->getId());
echo "\n";
}
$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk');
d($df);
//changing the calendar with a cal type should not change tz
$df->setCalendar(IntlDateFormatter::TRADITIONAL);
d($df);
//but changing with an actual calendar should
$cal = IntlCalendar::createInstance("UTC");
$df->setCalendar($cal);
d($df);
?>
==DONE==
--EXPECT--
dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad
int(1)
string(9) "gregorian"
string(12) "Europe/Minsk"
dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad
int(0)
string(7) "islamic"
string(12) "Europe/Minsk"
dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 Temps universel coordonné
bool(false)
string(9) "gregorian"
string(3) "UTC"
==DONE==
@@ -3,6 +3,7 @@ numfmt_get_locale()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU < 58.1'); ?>
--FILE--
<?php
@@ -0,0 +1,50 @@
--TEST--
numfmt_get_locale()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
--FILE--
<?php
/*
* Get locale.
*/
function ut_main()
{
$locales = array(
'en_UK',
'en_US',
'fr_CA',
);
$loc_types = array(
Locale::ACTUAL_LOCALE => 'actual',
Locale::VALID_LOCALE => 'valid',
);
$res_str = '';
foreach( $locales as $locale )
{
$fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
$res_str .= "$locale: ";
foreach( $loc_types as $loc_type => $loc_type_name )
$res_str .= sprintf( " %s=%s",
$loc_type_name,
dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
$res_str .= "\n";
}
return $res_str;
}
include_once( 'ut_common.inc' );
// Run the test
ut_run();
?>
--EXPECT--
en_UK: actual='en' valid='en'
en_US: actual='en' valid='en_US'
fr_CA: actual='fr' valid='fr_CA'
+1
View File
@@ -2,6 +2,7 @@
spoofchecker suspicious character checker
--SKIPIF--
<?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '57.1') >= 0)die('skip for ICU <= 57.1'); ?>
--FILE--
<?php
+26
View File
@@ -0,0 +1,26 @@
--TEST--
spoofchecker suspicious character checker
--SKIPIF--
<?php if(!extension_loaded('intl') || !class_exists("Spoofchecker")) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '57.1') < 0) die('skip for ICU >= 58.1'); ?>
--FILE--
<?php
echo "paypal with Cyrillic spoof characters\n";
$x = new Spoofchecker();
var_dump($x->isSuspicious("http://www.payp\u{0430}l.com"));
var_dump($x->isSuspicious("\u{041F}aypal.com"));
echo "certain all-uppercase Latin sequences can be spoof of Greek\n";
$x = new Spoofchecker();
$x->setAllowedLocales("gr_GR");
var_dump($x->isSuspicious("NAPKIN PEZ"));
var_dump($x->isSuspicious("napkin pez"));
?>
--EXPECTF--
paypal with Cyrillic spoof characters
bool(true)
bool(true)
certain all-uppercase Latin sequences can be spoof of Greek
bool(true)
bool(true)
@@ -2,6 +2,7 @@
UConverter::convert() w/ Callback Reasons
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
--FILE--
<?php
class MyConverter extends UConverter {
@@ -0,0 +1,57 @@
--TEST--
UConverter::convert() w/ Callback Reasons
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '60.1') < 0) die('skip for ICU >= 60.1'); ?>
--FILE--
<?php
class MyConverter extends UConverter {
/**
* Called during conversion from source encoding to internal UChar representation
*/
public function toUCallback($reason, $source, $codeUnits, &$error) {
echo "toUCallback(", UConverter::reasonText($reason), ", ...)\n";
return parent::toUCallback($reason, $source, $codeUnits, $error);
}
/**
* Called during conversion from internal UChar to destination encoding
*/
public function fromUCallback($reason, $source, $codePoint, &$error) {
echo "fromUCallback(", UConverter::reasonText($reason), ", ...)\n";
return parent::fromUCallback($reason, $source, $codePoint, $error);
}
}
$c = new MyConverter('ascii', 'utf-8');
foreach(array("regular", "irregul\xC1\xA1r", "\xC2\xA1unsupported!") as $word) {
$c->convert($word);
}
--EXPECT--
toUCallback(REASON_RESET, ...)
toUCallback(REASON_RESET, ...)
fromUCallback(REASON_RESET, ...)
fromUCallback(REASON_RESET, ...)
toUCallback(REASON_RESET, ...)
toUCallback(REASON_ILLEGAL, ...)
toUCallback(REASON_ILLEGAL, ...)
toUCallback(REASON_RESET, ...)
toUCallback(REASON_ILLEGAL, ...)
toUCallback(REASON_ILLEGAL, ...)
fromUCallback(REASON_RESET, ...)
fromUCallback(REASON_UNASSIGNED, ...)
fromUCallback(REASON_UNASSIGNED, ...)
fromUCallback(REASON_RESET, ...)
fromUCallback(REASON_UNASSIGNED, ...)
fromUCallback(REASON_UNASSIGNED, ...)
toUCallback(REASON_RESET, ...)
toUCallback(REASON_RESET, ...)
fromUCallback(REASON_RESET, ...)
fromUCallback(REASON_UNASSIGNED, ...)
fromUCallback(REASON_RESET, ...)
fromUCallback(REASON_UNASSIGNED, ...)
toUCallback(REASON_CLOSE, ...)
fromUCallback(REASON_CLOSE, ...)
toUCallback(REASON_CLOSE, ...)
fromUCallback(REASON_CLOSE, ...)
+2 -2
View File
@@ -132,7 +132,7 @@ IC_METHOD(getIntPropertyMinValue) {
}
/* }}} */
/* {{{ proto int IntlChar::getIntPropertyMxValue(int $property) */
/* {{{ proto int IntlChar::getIntPropertyMaxValue(int $property) */
ZEND_BEGIN_ARG_INFO_EX(getIntPropertyMaxValue_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, property)
ZEND_END_ARG_INFO();
@@ -179,7 +179,7 @@ static UBool enumCharType_callback(enumCharType_data *context,
zval args[3];
ZVAL_NULL(&retval);
/* Note that $start is INclusive, whiel $limit is EXclusive
/* Note that $start is INclusive, while $limit is EXclusive
* Therefore (0, 32, 15) means CPs 0..31 are of type 15
*/
ZVAL_LONG(&args[0], start);
+1 -1
View File
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
php_stream_bucket_delref(bucket);
} else {
/* Stream cipher */
php_stream_bucket_make_writeable(bucket);
bucket = php_stream_bucket_make_writeable(bucket);
if (data->encrypt) {
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #72535 arcfour encryption stream filter crashes php
--SKIPIF--
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
--FILE--
<?php
$passphrase = 'My secret';
$plaintext = 'Secret secret secret data';
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
$key = substr(md5('pass1' . $passphrase, true) .
md5('pass2' . $passphrase, true), 0, 24);
$opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
$expected = substr($plaintext . $plaintext, 0, 48);
$fp = fopen('php://memory', 'wb+');
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
fwrite($fp, $plaintext);
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
+2 -2
View File
@@ -420,7 +420,7 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_fetch_field_direct, arginfo_mysqli_result_and_fieldnr)
PHP_FE(mysqli_fetch_lengths, arginfo_mysqli_only_result)
#ifdef MYSQLI_USE_MYSQLND
PHP_FE(mysqli_fetch_all, arginfo_mysqli_only_result)
PHP_FE(mysqli_fetch_all, arginfo_mysqli_fetch_array)
#endif
PHP_FE(mysqli_fetch_array, arginfo_mysqli_fetch_array)
PHP_FE(mysqli_fetch_assoc, arginfo_mysqli_only_result)
@@ -600,7 +600,7 @@ const zend_function_entry mysqli_result_methods[] = {
PHP_FALIAS(fetch_fields, mysqli_fetch_fields, arginfo_mysqli_no_params)
PHP_FALIAS(fetch_field_direct, mysqli_fetch_field_direct, arginfo_class_mysqli_result_and_fieldnr)
#if defined(MYSQLI_USE_MYSQLND)
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_mysqli_no_params)
PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_class_mysqli_fetch_array)
#endif
PHP_FALIAS(fetch_array, mysqli_fetch_array, arginfo_class_mysqli_fetch_array)
PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #75434 Wrong reflection for mysqli_fetch_all function
--SKIPIF--
<?php
require_once('skipif.inc');
if (!extension_loaded("reflection")) die("skip reflection extension not available");
?>
--FILE--
<?php
$rf = new ReflectionFunction('mysqli_fetch_all');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
$rm = new ReflectionMethod('mysqli_result', 'fetch_all');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(2)
int(1)
int(1)
int(0)
===DONE===
@@ -124,9 +124,16 @@ isInternal: yes
isUserDefined: no
returnsReference: no
Modifiers: 256
Number of Parameters: 0
Number of Parameters: 1
Number of Required Parameters: 0
Inspecting parameter 'result_type' of method 'fetch_all'
isArray: no
allowsNull: no
isPassedByReference: no
isOptional: yes
isDefaultValueAvailable: no
Inspecting method 'fetch_array'
isFinal: no
isAbstract: no
+8 -7
View File
@@ -1611,14 +1611,15 @@ PHP_FUNCTION(oci_close)
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (GC_REFCOUNT(connection->id) == 2) /* CHANGED VERSION::PHP7
Changed the refCount to 2 since
internally Zend engine increments
RefCount value by 1 */
if (GC_REFCOUNT(connection->id) == 2) { /* CHANGED VERSION::PHP7
Changed the refCount to 2 since
internally Zend engine increments
RefCount value by 1 */
/* Unregister Oracle TAF */
php_oci_unregister_taf_callback(connection);
zend_list_close(connection->id);
/* Unregister Oracle TAF */
php_oci_unregister_taf_callback(connection);
}
/* ZVAL_NULL(z_connection); */
+19 -3
View File
@@ -56,8 +56,8 @@ Interoperability Support" (ID 207303.1) for details.
<time>12:00:00</time>
<version>
<release>2.1.7</release>
<api>2.1.7</api>
<release>2.1.8</release>
<api>2.1.8</api>
</version>
<stability>
<release>stable</release>
@@ -66,7 +66,7 @@ Interoperability Support" (ID 207303.1) for details.
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Added oci_unregister_taf_callback()
Fixed reference counting and memory issues. (Dmitry, Tianfang)
</notes>
<contents>
<dir name="/">
@@ -476,6 +476,22 @@ Added oci_unregister_taf_callback()
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.7</release>
<api>2.1.7</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Added oci_unregister_taf_callback()
</notes>
</release>
<release>
<version>
<release>2.1.6</release>
+3 -3
View File
@@ -57,11 +57,11 @@ function get_attr($conn)
?>
--EXPECT--
**Test 1.1 - Default values for the attribute **************
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
***Test 1.2 - Get the values from different connections **************
Testing with oci_pconnect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
Testing with oci_new_connect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
The value of DRIVER_NAME is PHP OCI8 : 2.1.8
Done
+2 -2
View File
@@ -1221,7 +1221,7 @@ static zend_persistent_script *cache_script_in_file_cache(zend_persistent_script
zend_shared_alloc_init_xlat_table();
/* Calculate the required memory size */
memory_used = zend_accel_script_persist_calc(new_persistent_script, NULL, 0);
memory_used = zend_accel_script_persist_calc(new_persistent_script, NULL, 0, 0);
/* Allocate memory block */
#ifdef __SSE2__
@@ -1309,7 +1309,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
zend_shared_alloc_init_xlat_table();
/* Calculate the required memory size */
memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length);
memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length, 1);
/* Allocate shared memory */
#ifdef __SSE2__
+1 -1
View File
@@ -23,7 +23,7 @@
#define ZEND_PERSIST_H
int zend_accel_script_persistable(zend_persistent_script *script);
uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length);
uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length, int for_shm);
zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
#endif /* ZEND_PERSIST_H */
+6 -4
View File
@@ -381,7 +381,7 @@ static void zend_accel_persist_class_table_calc(HashTable *class_table)
zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
}
uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length)
uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int for_shm)
{
new_persistent_script->mem = NULL;
new_persistent_script->size = 0;
@@ -390,12 +390,14 @@ uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_scrip
new_persistent_script->corrupted = 0;
ZCG(current_persistent_script) = new_persistent_script;
if (!for_shm) {
/* script is not going to be saved in SHM */
new_persistent_script->corrupted = 1;
}
ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script));
if (key) {
ADD_DUP_SIZE(key, key_length + 1);
} else {
/* script is not going to be saved in SHM */
new_persistent_script->corrupted = 1;
}
ADD_STRING(new_persistent_script->full_path);
+36 -38
View File
@@ -358,17 +358,18 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_seal, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, sealdata)
ZEND_ARG_INFO(1, ekeys) /* arary */
ZEND_ARG_INFO(1, ekeys) /* array */
ZEND_ARG_INFO(0, pubkeys) /* array */
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(1, iv)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_openssl_open, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_open, 0, 0, 4)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(1, opendata)
ZEND_ARG_INFO(0, ekey)
ZEND_ARG_INFO(0, privkey)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, iv)
ZEND_END_ARG_INFO()
@@ -1586,10 +1587,11 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
if (!what) {
return NULL;
}
/* this is so callers can decide if they should free the X509 */
if (resourceval) {
*resourceval = res;
Z_ADDREF_P(val);
if (makeresource) {
Z_ADDREF_P(val);
}
}
return (X509*)what;
}
@@ -1646,7 +1648,6 @@ PHP_FUNCTION(openssl_x509_export_to_file)
zval * zcert;
zend_bool notext = 1;
BIO * bio_out;
zend_resource *certresource;
char * filename;
size_t filename_len;
@@ -1655,7 +1656,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
}
RETVAL_FALSE;
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
@@ -1676,7 +1677,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
} else {
php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
BIO_free(bio_out);
@@ -1968,14 +1969,13 @@ PHP_FUNCTION(openssl_x509_export)
zval * zcert, *zout;
zend_bool notext = 1;
BIO * bio_out;
zend_resource *certresource;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|b", &zcert, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
@@ -1995,7 +1995,7 @@ PHP_FUNCTION(openssl_x509_export)
RETVAL_TRUE;
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
BIO_free(bio_out);
@@ -2032,7 +2032,6 @@ PHP_FUNCTION(openssl_x509_fingerprint)
{
X509 *cert;
zval *zcert;
zend_resource *certresource;
zend_bool raw_output = 0;
char *method = "sha1";
size_t method_len;
@@ -2042,7 +2041,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
return;
}
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
RETURN_FALSE;
@@ -2055,7 +2054,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
RETVAL_FALSE;
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
}
@@ -2067,14 +2066,14 @@ PHP_FUNCTION(openssl_x509_check_private_key)
zval * zcert, *zkey;
X509 * cert = NULL;
EVP_PKEY * key = NULL;
zend_resource *certresource = NULL, *keyresource = NULL;
zend_resource *keyresource = NULL;
RETVAL_FALSE;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zcert, &zkey) == FAILURE) {
return;
}
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
RETURN_FALSE;
}
@@ -2086,7 +2085,7 @@ PHP_FUNCTION(openssl_x509_check_private_key)
if (keyresource == NULL && key) {
EVP_PKEY_free(key);
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
}
@@ -2168,7 +2167,6 @@ PHP_FUNCTION(openssl_x509_parse)
{
zval * zcert;
X509 * cert = NULL;
zend_resource *certresource = NULL;
int i, sig_nid;
zend_bool useshortnames = 1;
char * tmpstr;
@@ -2188,7 +2186,7 @@ PHP_FUNCTION(openssl_x509_parse)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcert, &useshortnames) == FAILURE) {
return;
}
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
RETURN_FALSE;
}
@@ -2298,10 +2296,10 @@ PHP_FUNCTION(openssl_x509_parse)
add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length);
} else {
zval_dtor(return_value);
if (certresource == NULL && cert) {
BIO_free(bio_out);
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
BIO_free(bio_out);
RETURN_FALSE;
}
}
@@ -2314,8 +2312,7 @@ PHP_FUNCTION(openssl_x509_parse)
BIO_free(bio_out);
}
add_assoc_zval(return_value, "extensions", &subitem);
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
}
@@ -2404,7 +2401,6 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
zval * zcert, * zcainfo = NULL;
X509_STORE * cainfo = NULL;
X509 * cert = NULL;
zend_resource *certresource = NULL;
STACK_OF(X509) * untrustedchain = NULL;
zend_long purpose;
char * untrusted = NULL;
@@ -2428,7 +2424,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
if (cainfo == NULL) {
goto clean_exit;
}
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
goto clean_exit;
}
@@ -2439,11 +2435,10 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
} else {
RETVAL_BOOL(ret);
}
clean_exit:
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
clean_exit:
if (cainfo) {
X509_STORE_free(cainfo);
}
@@ -2630,7 +2625,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
size_t pass_len;
zval *zcert = NULL, *zpkey = NULL, *args = NULL;
EVP_PKEY *priv_key = NULL;
zend_resource *certresource, *keyresource;
zend_resource *keyresource;
zval * item;
STACK_OF(X509) *ca = NULL;
@@ -2639,7 +2634,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
RETVAL_FALSE;
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
@@ -2649,7 +2644,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
if (!X509_check_private_key(cert, priv_key)) {
php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
@@ -2693,7 +2688,8 @@ cleanup:
if (keyresource == NULL && priv_key) {
EVP_PKEY_free(priv_key);
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
}
@@ -2708,7 +2704,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
PKCS12 * p12 = NULL;
zval * zcert = NULL, *zout = NULL, *zpkey, *args = NULL;
EVP_PKEY *priv_key = NULL;
zend_resource *certresource, *keyresource;
zend_resource *keyresource;
char * pass;
size_t pass_len;
char * friendly_name = NULL;
@@ -2720,7 +2716,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
RETVAL_FALSE;
cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
cert = php_openssl_x509_from_zval(zcert, 0, NULL);
if (cert == NULL) {
php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
@@ -2730,7 +2726,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
if (!X509_check_private_key(cert, priv_key)) {
php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
@@ -2765,7 +2761,7 @@ cleanup:
if (keyresource == NULL && priv_key) {
EVP_PKEY_free(priv_key);
}
if (certresource == NULL && cert) {
if (Z_TYPE_P(zcert) != IS_RESOURCE) {
X509_free(cert);
}
}
@@ -3052,7 +3048,9 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
if (what) {
if (resourceval) {
*resourceval = res;
Z_ADDREF_P(val);
if (makeresource) {
Z_ADDREF_P(val);
}
}
return (X509_REQ*)what;
}
@@ -5342,7 +5340,7 @@ PHP_FUNCTION(openssl_verify)
}
/* }}} */
/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys)
/* {{{ proto int openssl_seal(string data, &string sealdata, &array ekeys, array pubkeys [, string method [, &string iv]]))
Seals data */
PHP_FUNCTION(openssl_seal)
{
@@ -5471,7 +5469,7 @@ clean_exit:
}
/* }}} */
/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey)
/* {{{ proto bool openssl_open(string data, &string opendata, string ekey, mixed privkey [, string method [, string iv]])
Opens data */
PHP_FUNCTION(openssl_open)
{
+2 -9
View File
@@ -9,15 +9,6 @@ if (!@openssl_pkey_new()) die("skip cannot create private key");
<?php
echo "Creating private key\n";
/* stack up some entropy; performance is not critical,
* and being slow will most likely even help the test.
*/
for ($z = "", $i = 0; $i < 1024; $i++) {
$z .= $i * $i;
if (function_exists("usleep"))
usleep($i);
}
$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf');
$privkey = openssl_pkey_new($conf);
@@ -32,6 +23,7 @@ if ($key_file_name === false)
echo "Export key to file\n";
openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to export to file $key_file_name");
var_dump(is_resource($privkey));
echo "Load key from file - array syntax\n";
@@ -69,6 +61,7 @@ echo "OK!\n";
--EXPECT--
Creating private key
Export key to file
bool(true)
Load key from file - array syntax
Load key using direct syntax
Load key manually and use string syntax
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75307 Wrong reflection for openssl_open function
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not available");
if (!extension_loaded("reflection")) die("skip reflection not available");
?>
--FILE--
<?php
$rf = new ReflectionFunction('openssl_open');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(6)
int(4)
===DONE===
@@ -0,0 +1,83 @@
--TEST--
openssl_csr_export_to_file() tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$csrfile = dirname(__FILE__) . "/openssl_csr_export_to_file_csr.tmp";
$wrong = "wrong";
$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
$phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' .
'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' .
'7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' .
'6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab';
$dh_details = array('p' => $phex, 'g' => '2');
$dh = openssl_pkey_new(array(
'dh'=> array('p' => hex2bin($phex), 'g' => '2'))
);
$dn = array(
"countryName" => "BR",
"stateOrProvinceName" => "Rio Grande do Sul",
"localityName" => "Porto Alegre",
"commonName" => "Henrique do N. Angelo",
"emailAddress" => "hnangelo@php.net"
);
$args = array(
"digest_alg" => "sha1",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_DSA,
"encrypt_key" => true,
"config" => $config,
);
$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
var_dump(openssl_csr_export_to_file($csr, $csrfile));
var_dump(file_get_contents($csrfile));
var_dump(openssl_csr_export_to_file($wrong, $csrfile));
var_dump(openssl_csr_export_to_file($dh, $csrfile));
var_dump(openssl_csr_export_to_file(array(), $csrfile));
var_dump(openssl_csr_export_to_file($csr, $csrfile, false));
?>
--CLEAN--
<?php
$csrfile = dirname(__FILE__) . "/openssl_csr_export_to_file_csr.tmp";
if (file_exists($csrfile)) {
unlink($csrfile);
}
?>
--EXPECTF--
bool(true)
string(1086) "-----BEGIN CERTIFICATE REQUEST-----
MIIC6jCCAdICAQAwgaQxCzAJBgNVBAYTAkJSMRowGAYDVQQIExFSaW8gR3JhbmRl
IGRvIFN1bDEVMBMGA1UEBxMMUG9ydG8gQWxlZ3JlMR4wHAYDVQQDExVIZW5yaXF1
ZSBkbyBOLiBBbmdlbG8xHzAdBgkqhkiG9w0BCQEWEGhuYW5nZWxvQHBocC5uZXQx
ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAK21JlVtWPqyc2UQtw2AdJHSIL5OzAHWsu/Mmxjz
w4VZWwG+Ao1m2j7OJ8lAkxLfSlRtB+6Vx8Q21krAtve+M3b6pT9C9qKdfzNkrXk3
BggTncBh9ozkVQGS/P1m0zn/SKSgDO+6DdeLHLMjpUASaoYfsay4PJLAdnTqLOeM
g6qNE6u0ebZXVfmpSmV1pSZ6kQnxbsb6rX1iOZxkwHnVWYb40Hy0EILo31x6BVqB
m159m7s38ChiRHqlj20DmRfxXjiT5YDgYYQ29wQBTVQrTN5O9UW5Y+eKTXd8r6te
dsbIBXdKN7NeX7ksGYHq1I3hLsP8EyvZO78qfjKyEB0Jj3UCAwEAAaAAMA0GCSqG
SIb3DQEBBQUAA4IBAQCamzVmIbElkiDQKzQpkfU5tHjrWPrHDSB186NI0sQ8i6GQ
1YT6yPAXBPTQ1aER/6uAZJL5HfWEX8V1rKbe8GkPAPCHHQzmHyWlaO2EHS57zJhk
sRrhqkhhkSNiDg4OrsguhRtbB2VMGeDbqHGI89uGqqGHUiZc/Bh8N7WFXZkUU/A0
sfBgVeqg0P4SWez5fHXqBNcjMdMI5f0bikcDZSIfTHS8FX+PMurLBC8UPB0YNIOl
1r2Lvo+6YUHOziG1OwQd3K0xxu/JzzOE+lMB73ynz4V6DY5Qv3qVno1GpupvgmQA
JViHkCA9x6m8RJXAFvqmgLlWlUzbDv/cRrDfjWjR
-----END CERTIFICATE REQUEST-----
"
Warning: openssl_csr_export_to_file() expects parameter 1 to be resource, string given in %s on line %d
NULL
Warning: openssl_csr_export_to_file(): supplied resource is not a valid OpenSSL X.509 CSR resource in %s on line %d
Warning: openssl_csr_export_to_file(): cannot get CSR from parameter 1 in %s on line %d
bool(false)
Warning: openssl_csr_export_to_file() expects parameter 1 to be resource, array given in %s on line %d
NULL
bool(true)
@@ -0,0 +1,44 @@
--TEST--
openssl_csr_get_public_key() tests
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
$phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' .
'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' .
'7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' .
'6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab';
$dh_details = array('p' => $phex, 'g' => '2');
$dh = openssl_pkey_new(array(
'dh'=> array('p' => hex2bin($phex), 'g' => '2'))
);
$dn = array(
"countryName" => "BR",
"stateOrProvinceName" => "Rio Grande do Sul",
"localityName" => "Porto Alegre",
"commonName" => "Henrique do N. Angelo",
"emailAddress" => "hnangelo@php.net"
);
$args = array(
"digest_alg" => "sha1",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_DSA,
"encrypt_key" => true,
"config" => $config,
);
$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr');
var_dump(openssl_csr_get_public_key($csr));
var_dump(openssl_csr_get_public_key($csr_file));
?>
--EXPECTF--
resource(%d) of type (OpenSSL key)
resource(%d) of type (OpenSSL key)
@@ -2,19 +2,43 @@
openssl_csr_get_subject() tests
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
if (!function_exists("utf8_decode")) die("skip");
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
$phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' .
'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' .
'7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' .
'6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab';
$dh_details = array('p' => $phex, 'g' => '2');
$dh = openssl_pkey_new(array(
'dh'=> array('p' => hex2bin($phex), 'g' => '2'))
);
$csr = file_get_contents(dirname(__FILE__) . '/cert.csr');
if ($out = openssl_csr_get_subject($csr, 1)) {
var_dump($out);
}
echo "\n";
$cn = utf8_decode($out['CN']);
var_dump($cn);
$dn = array(
"countryName" => "BR",
"stateOrProvinceName" => "Rio Grande do Sul",
"localityName" => "Porto Alegre",
"commonName" => "Henrique do N. Angelo",
"emailAddress" => "hnangelo@php.net"
);
$args = array(
"digest_alg" => "sha1",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_DSA,
"encrypt_key" => true,
"config" => $config,
);
$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr');
var_dump(openssl_csr_get_subject($csr_file));
var_dump(openssl_csr_get_subject($csr, false));
?>
--EXPECTF--
array(6) {
["C"]=>
@@ -30,5 +54,17 @@ array(6) {
["CN"]=>
string(15) "*.triconnect.nl"
}
string(15) "*.triconnect.nl"
array(6) {
["countryName"]=>
string(2) "BR"
["stateOrProvinceName"]=>
string(17) "Rio Grande do Sul"
["localityName"]=>
string(12) "Porto Alegre"
["commonName"]=>
string(21) "Henrique do N. Angelo"
["emailAddress"]=>
string(16) "hnangelo@php.net"
["organizationName"]=>
string(24) "Internet Widgits Pty Ltd"
}
@@ -32,6 +32,7 @@ $csr = openssl_csr_new($dn, $privkey, $args);
var_dump(openssl_csr_sign($csr, null, $privkey, 365, $args));
var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg));
var_dump(openssl_csr_sign($csr, $cert, $priv, 365, $config_arg));
var_dump(openssl_csr_sign($csr, openssl_x509_read($cert), $priv, 365, $config_arg));
var_dump(openssl_csr_sign($csr, $wrong, $privkey, 365));
var_dump(openssl_csr_sign($csr, null, $wrong, 365));
var_dump(openssl_csr_sign($csr, null, $privkey, $wrong));
@@ -47,6 +48,7 @@ var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg));
resource(%d) of type (OpenSSL X.509)
resource(%d) of type (OpenSSL X.509)
resource(%d) of type (OpenSSL X.509)
resource(%d) of type (OpenSSL X.509)
Warning: openssl_csr_sign(): cannot get cert from parameter 2 in %s on line %d
bool(false)
@@ -14,7 +14,7 @@ $cert_res = openssl_x509_read($cert);
$priv_res = openssl_pkey_get_private($priv);
$pass = "test";
$invalid = "";
$invalid_path = "file:///tmp/php";
$invalid_path = dirname(__FILE__) . "/invalid_path";
$opts = [];
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass)); // read certs as a string
@@ -23,9 +23,9 @@ var_dump(openssl_pkcs12_export($cert_path, $output, $priv_path, $pass)); // read
var_dump(openssl_pkcs12_read($output, $opts, $pass));
var_dump(openssl_pkcs12_export($cert_res, $output, $priv_res, $pass)); // read certs from a resource
var_dump(openssl_pkcs12_read($output, $opts, $pass));
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array($cert))); // extra optional cert
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array('extracerts' => $cert))); // extra optional cert
var_dump(openssl_pkcs12_read($output, $opts, $pass));
//var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
var_dump(openssl_pkcs12_export($invalid, $output, $invalid, $pass));
@@ -42,6 +42,7 @@ bool(true)
bool(true)
bool(true)
bool(true)
int(3)
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
bool(false)
@@ -16,7 +16,7 @@ $cert_res = openssl_x509_read($cert);
$priv_res = openssl_pkey_get_private($priv);
$pass = "test";
$invalid = "";
$invalid_path = "file:///tmp/php";
$invalid_path = dirname(__FILE__) . "/invalid_path";
$opts = [];
var_dump(openssl_pkcs12_export_to_file($cert, $pkcsfile, $priv, $pass));
@@ -34,6 +34,7 @@ var_dump(openssl_pkcs12_export_to_file($priv_res, $pkcsfile, $cert_res, $pass));
?>
--CLEAN--
<?php
$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
if (file_exists($pkcsfile)) {
unlink($pkcsfile);
}
@@ -22,6 +22,7 @@ $empty = "";
openssl_pkcs7_encrypt($infile, $encrypted, $single_cert, $headers);
var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $single_cert, $privkey));
var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, openssl_x509_read($single_cert), $privkey));
var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $single_cert, $wrong));
var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $wrong, $privkey));
var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, null, $privkey));
@@ -42,6 +43,7 @@ if (file_exists($outfile)) {
?>
--EXPECTF--
bool(true)
bool(true)
Warning: openssl_pkcs7_decrypt(): unable to get private key in %s on line %d
bool(false)
@@ -22,6 +22,7 @@ $wrong = "wrong";
$empty = "";
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $headers));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, openssl_x509_read($single_cert), $headers));
var_dump(openssl_pkcs7_decrypt($outfile, $outfile2, $single_cert, $privkey));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $assoc_headers));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty_headers));
@@ -33,6 +34,7 @@ var_dump(openssl_pkcs7_encrypt($infile, $outfile, $wrong, $headers));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $empty, $headers));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, $multi_certs, $headers));
var_dump(openssl_pkcs7_encrypt($infile, $outfile, array_map('openssl_x509_read', $multi_certs) , $headers));
if (file_exists($outfile)) {
echo "true\n";
@@ -48,6 +50,7 @@ bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d
bool(false)
@@ -60,5 +63,6 @@ bool(false)
Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d
bool(false)
bool(true)
bool(true)
true
true
@@ -18,6 +18,7 @@ $empty_headers = array();
$wrong = "wrong";
$empty = "";
var_dump(openssl_pkcs7_sign($infile, $outfile, openssl_x509_read($single_cert), $privkey, $headers));
var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $headers));
var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $assoc_headers));
var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $empty_headers));
@@ -39,6 +40,7 @@ if (file_exists($outfile)) {
bool(true)
bool(true)
bool(true)
bool(true)
Warning: openssl_pkcs7_sign() expects parameter 5 to be array, string given in %s on line %d
NULL
@@ -37,7 +37,7 @@ $tempname = tempnam(sys_get_temp_dir(), 'openssl_ec');
var_dump(openssl_pkey_export_to_file($key, $tempname, NULL, $config_arg));
$details = openssl_pkey_get_details(openssl_pkey_get_private('file://' . $tempname));
var_dump(OPENSSL_KEYTYPE_EC === $details['type']);
var_dump(is_resource($key));
// Clean the temporary file
@unlink($tempname);
@@ -52,3 +52,4 @@ resource(%d) of type (OpenSSL key)
bool(true)
bool(true)
bool(true)
bool(true)
@@ -19,7 +19,7 @@ var_dump(openssl_x509_check_private_key($cert, $key));
var_dump(openssl_x509_check_private_key("", $key));
var_dump(openssl_x509_check_private_key($cert, ""));
var_dump(openssl_x509_check_private_key("", ""));
var_dump(openssl_x509_check_private_key($a, $b));
var_dump(openssl_x509_check_private_key(openssl_x509_read($a), $b));
?>
--EXPECT--
bool(true)
@@ -13,6 +13,7 @@ $bert = "file://" . dirname(__FILE__) . "/bug41033.pem";
$sert = "file://" . dirname(__FILE__) . "/san-cert.pem";
$cpca = dirname(__FILE__) . "/san-ca.pem";
$utfl = dirname(__FILE__) . "/sni_server_domain1.pem";
$rcrt = openssl_x509_read($cert);
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose); */
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SSL_CLIENT));
@@ -44,7 +45,7 @@ var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_NS_SSL_SERVER, array($cpc
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SMIME_SIGN, array($cpca)));
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca)));
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_CRL_SIGN, array($cpca)));
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_ANY, array($cpca)));
var_dump(openssl_x509_checkpurpose($rcrt, X509_PURPOSE_ANY, array($cpca)));
var_dump(openssl_x509_checkpurpose($bert, X509_PURPOSE_SSL_CLIENT, array($cpca)));
var_dump(openssl_x509_checkpurpose($bert, X509_PURPOSE_SSL_SERVER, array($cpca)));
var_dump(openssl_x509_checkpurpose($bert, X509_PURPOSE_NS_SSL_SERVER, array($cpca)));
@@ -21,10 +21,15 @@ var_dump(openssl_x509_fingerprint($cert, 'md5'));
echo "**Testing raw output md5 **\n";
var_dump(bin2hex(openssl_x509_fingerprint($cert, 'md5', true)));
echo "** Testing hash method sha1 with resource **\n";
$r = openssl_x509_read($cert);
var_dump(openssl_x509_fingerprint($r, 'sha1'));
echo "** Testing bad certification **\n";
var_dump(openssl_x509_fingerprint('123'));
echo "** Testing bad hash method **\n";
var_dump(openssl_x509_fingerprint($cert, 'xx45'));
?>
--EXPECTF--
** Testing with no parameters **
@@ -36,6 +41,8 @@ string(40) "6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c"
string(32) "ac77008e172897e06c0b065294487a67"
**Testing raw output md5 **
string(32) "ac77008e172897e06c0b065294487a67"
** Testing hash method sha1 with resource **
string(40) "6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c"
** Testing bad certification **
Warning: openssl_x509_fingerprint(): cannot get cert from parameter 1 in %s on line %d
@@ -8,10 +8,13 @@ if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0")
<?php
$cert = "file://" . dirname(__FILE__) . "/cert.crt";
var_dump(openssl_x509_parse($cert));
$parsedCert = openssl_x509_parse($cert);
var_dump($parsedCert === openssl_x509_parse(openssl_x509_read($cert)));
var_dump($parsedCert);
var_dump(openssl_x509_parse($cert, false));
?>
--EXPECTF--
bool(true)
array(16) {
["name"]=>
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
+3 -1
View File
@@ -2025,7 +2025,9 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt)
struct pdo_column_data *cols = stmt->columns;
for (i = 0; i < stmt->column_count; i++) {
zend_string_release(cols[i].name);
if (cols[i].name) {
zend_string_release(cols[i].name);
}
}
efree(stmt->columns);
stmt->columns = NULL;
+1 -1
View File
@@ -12,7 +12,7 @@ $db = PDOTest::factory();
$client_version = $db->getAttribute(PDO::ATTR_CLIENT_VERSION);
$server_version = $db->getAttribute(PDO::ATTR_SERVER_VERSION);
if (version_compare($server_version, '7.4', '<') || version_compare($client_version, '7.4', '<')) {
if (version_compare($server_version, '7.4', '<') || version_compare($client_version, '7.4', '<') || version_compare($server_version, '10', '>=')) {
die('skip');
}
+8 -13
View File
@@ -1562,32 +1562,27 @@ PHP_FUNCTION(pg_close)
{
zval *pgsql_link = NULL;
zend_resource *link;
int argc = ZEND_NUM_ARGS();
PGconn *pgsql;
if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) {
return;
}
if (argc == 0) {
if (pgsql_link) {
link = Z_RES_P(pgsql_link);
} else {
link = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(link);
} else {
link = Z_RES_P(pgsql_link);
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
if (zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink) == NULL) {
RETURN_FALSE;
}
if (argc == 0) { /* explicit resource number */
zend_list_close(link);
}
if (argc || (pgsql_link && Z_RES_P(pgsql_link) == PGG(default_link))) {
zend_list_close(link);
if (link == PGG(default_link)) {
zend_list_delete(link);
PGG(default_link) = NULL;
}
zend_list_close(link);
RETURN_TRUE;
}
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff. Show more