mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 10:25:41 +00:00
Compare commits
257
Commits
PHP-5.5.16
...
PHP-5.5.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eb2a1067c | ||
|
|
ae106ba62f | ||
|
|
8736632499 | ||
|
|
64af3c21e6 | ||
|
|
13a218d328 | ||
|
|
deadeeae1d | ||
|
|
88527e4569 | ||
|
|
3c925b18fa | ||
|
|
22b9f16e9a | ||
|
|
270df3ffd6 | ||
|
|
ec3d25fcbd | ||
|
|
5b295bf191 | ||
|
|
37d5a2b18f | ||
|
|
8c9e254319 | ||
|
|
2b5bffe6c7 | ||
|
|
a1abdba1eb | ||
|
|
503f8193e8 | ||
|
|
2728e6f017 | ||
|
|
6d9c9f8f04 | ||
|
|
bb3d43fa05 | ||
|
|
ddb207e7fa | ||
|
|
d1e030db02 | ||
|
|
9aa9014523 | ||
|
|
44035de79f | ||
|
|
71ba533640 | ||
|
|
b73ef0ee4a | ||
|
|
c2cce33cba | ||
|
|
82b07b62c0 | ||
|
|
061cb9b807 | ||
|
|
d0e51f5ce9 | ||
|
|
09f9403a6e | ||
|
|
d319a0c1d8 | ||
|
|
df9078ea55 | ||
|
|
d21602c072 | ||
|
|
648673bffe | ||
|
|
b386991471 | ||
|
|
136dd53ac2 | ||
|
|
0874ef624c | ||
|
|
046c345de5 | ||
|
|
ef0eed7f5f | ||
|
|
0cc2600ec6 | ||
|
|
26ff3a4c1e | ||
|
|
d67c05bb89 | ||
|
|
93288d0095 | ||
|
|
25e65a7599 | ||
|
|
15ba757a2b | ||
|
|
2cf94189a2 | ||
|
|
4e7b31a0db | ||
|
|
d7b01aff89 | ||
|
|
cfe8a8b968 | ||
|
|
7319298ffe | ||
|
|
7f1239232e | ||
|
|
1a2a8c6d4e | ||
|
|
859913f6d4 | ||
|
|
91d3cd8559 | ||
|
|
46aa2c396b | ||
|
|
0c982798e0 | ||
|
|
ef39f40445 | ||
|
|
fcbe20d357 | ||
|
|
e6105ffb22 | ||
|
|
2711948d14 | ||
|
|
5d299509b4 | ||
|
|
16e2d954fc | ||
|
|
00e99dcafd | ||
|
|
2bfe92c90f | ||
|
|
28ed0119ac | ||
|
|
408b172017 | ||
|
|
bf046d6d66 | ||
|
|
efa7f87de4 | ||
|
|
7958793342 | ||
|
|
e64da8c20d | ||
|
|
5e977e69e1 | ||
|
|
5d9403f56c | ||
|
|
b8470e19e4 | ||
|
|
00525b824a | ||
|
|
ad0b63cad4 | ||
|
|
8cac75969e | ||
|
|
24b41a23b3 | ||
|
|
6dc6daf7e3 | ||
|
|
3411fe33a2 | ||
|
|
2775dc2b44 | ||
|
|
fdfc31a4f7 | ||
|
|
69ea7f9509 | ||
|
|
dff820cea3 | ||
|
|
3b78a24ee9 | ||
|
|
bf2f80b223 | ||
|
|
372844918a | ||
|
|
f86b2193a4 | ||
|
|
b9ac5e23fb | ||
|
|
aca474fa14 | ||
|
|
99f0760bfb | ||
|
|
bdac08bcdd | ||
|
|
d2e1a04b10 | ||
|
|
bc44eb6172 | ||
|
|
b16929ca72 | ||
|
|
bba16dde5d | ||
|
|
582f42b8d4 | ||
|
|
9266227402 | ||
|
|
72c9b0e12b | ||
|
|
592df89027 | ||
|
|
a734acd439 | ||
|
|
5e95b61639 | ||
|
|
70f92aa97e | ||
|
|
fe551c089a | ||
|
|
af85eff5b6 | ||
|
|
53fa6c5b6b | ||
|
|
4b9fcc01d4 | ||
|
|
30aceaf1a7 | ||
|
|
197095c29e | ||
|
|
21446cd7b6 | ||
|
|
e665a07ab9 | ||
|
|
e55c641792 | ||
|
|
b206b0e29d | ||
|
|
ee275e34c8 | ||
|
|
b38ca3adee | ||
|
|
302ccc195b | ||
|
|
30a73658c6 | ||
|
|
32be79dcfa | ||
|
|
7fac56e072 | ||
|
|
1e1b7c74fb | ||
|
|
52f35b984c | ||
|
|
f463523cda | ||
|
|
640214701c | ||
|
|
c8b3bce407 | ||
|
|
bda1cc6946 | ||
|
|
a90d05a430 | ||
|
|
cb41a7bad1 | ||
|
|
437612f656 | ||
|
|
c4fb183b9f | ||
|
|
54fbbded37 | ||
|
|
dbbf1c2a3c | ||
|
|
43ed561222 | ||
|
|
e9166fec62 | ||
|
|
713e9a7eaa | ||
|
|
6da2a977fc | ||
|
|
825ddbb3c6 | ||
|
|
9185cfd539 | ||
|
|
6d19358ae0 | ||
|
|
20941b71aa | ||
|
|
d382d6f3dc | ||
|
|
9360b6eeee | ||
|
|
aa6dc6c108 | ||
|
|
276bead9c4 | ||
|
|
359bc0ee2f | ||
|
|
ac4569621d | ||
|
|
cbe1597b74 | ||
|
|
b278be894f | ||
|
|
5a7039035c | ||
|
|
eb2360602e | ||
|
|
335d89ec4d | ||
|
|
5e9e0a2c74 | ||
|
|
88c48a4b95 | ||
|
|
2fefae4771 | ||
|
|
2b10db8e10 | ||
|
|
706aefb781 | ||
|
|
529da0f74c | ||
|
|
299d8f339f | ||
|
|
05d1612e16 | ||
|
|
36d05d75c8 | ||
|
|
2b9af967fb | ||
|
|
fac08a960b | ||
|
|
1504f7d630 | ||
|
|
be2128c805 | ||
|
|
3f42f2f5d1 | ||
|
|
6279246d2c | ||
|
|
48dc203408 | ||
|
|
7c4b5d9187 | ||
|
|
0407bdf252 | ||
|
|
7bfe9bf951 | ||
|
|
7ba1409a1a | ||
|
|
59c2477bc3 | ||
|
|
3468f03b6f | ||
|
|
35f32637b0 | ||
|
|
49387b31cf | ||
|
|
ff4cf1a838 | ||
|
|
eab42649ab | ||
|
|
008330e5b3 | ||
|
|
b7cd099ae0 | ||
|
|
4185633207 | ||
|
|
ad492ca932 | ||
|
|
481c4715d4 | ||
|
|
4e2c01617f | ||
|
|
c044164a96 | ||
|
|
d1dd71454d | ||
|
|
aeb633543b | ||
|
|
7311087cf0 | ||
|
|
1355ea60cc | ||
|
|
5e338836ff | ||
|
|
32314f6b67 | ||
|
|
babeca356b | ||
|
|
1847cf10c1 | ||
|
|
7fbc99e390 | ||
|
|
e4905b38b7 | ||
|
|
4b85f1d46a | ||
|
|
f6896e4395 | ||
|
|
de18f42047 | ||
|
|
934c35f586 | ||
|
|
8c247af1fc | ||
|
|
daa1fb8ba6 | ||
|
|
7aa776c7b4 | ||
|
|
39dd715382 | ||
|
|
b6ddcf9c71 | ||
|
|
d4df6d0200 | ||
|
|
75991561d6 | ||
|
|
84a4041ba4 | ||
|
|
a04c5536bb | ||
|
|
378ffd3cdf | ||
|
|
1ff30fd88c | ||
|
|
5ac2e5f850 | ||
|
|
6569db8808 | ||
|
|
58088c24eb | ||
|
|
7189039d65 | ||
|
|
0753c22e76 | ||
|
|
7df4087b98 | ||
|
|
637367fc73 | ||
|
|
ce5efa7adc | ||
|
|
41e1ccefd5 | ||
|
|
d72b943262 | ||
|
|
9444bc7997 | ||
|
|
547451796c | ||
|
|
05baed522f | ||
|
|
fd28010e20 | ||
|
|
990ecc12fc | ||
|
|
0fe07a0e74 | ||
|
|
1ffb7fddc2 | ||
|
|
c74efe1b2e | ||
|
|
b5051ff939 | ||
|
|
e2ba5c7987 | ||
|
|
8e9777a1f1 | ||
|
|
e644aad3f9 | ||
|
|
8ab4e2e90d | ||
|
|
b512adf78d | ||
|
|
2fe5bcbeb5 | ||
|
|
892def5f12 | ||
|
|
8d1d038509 | ||
|
|
6bd5a06894 | ||
|
|
ec002bd837 | ||
|
|
52de149ebc | ||
|
|
2326401fc1 | ||
|
|
7f527897fe | ||
|
|
d4b67896ec | ||
|
|
84605098bc | ||
|
|
ee1ab62763 | ||
|
|
d77ea459bd | ||
|
|
44be7b7f27 | ||
|
|
0335d2ef3e | ||
|
|
a0bb3fd679 | ||
|
|
eca037a51d | ||
|
|
f3230e3522 | ||
|
|
920e81b6f1 | ||
|
|
54267f40c6 | ||
|
|
21654a671f | ||
|
|
41eb63e78f | ||
|
|
3c328f0984 | ||
|
|
d780c2a673 | ||
|
|
d400b74296 | ||
|
|
08334293f8 |
No files matched your search
@@ -19,6 +19,7 @@
|
||||
*.tgz
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
|
||||
+12
@@ -385,6 +385,12 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hash
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -438,6 +444,12 @@ PRIMARY MAINTAINER: Frank M. Kromann
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -1,6 +1,112 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2014, PHP 5.5.16
|
||||
13 Nov 2014, PHP 5.5.19
|
||||
|
||||
- Core:
|
||||
. Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in
|
||||
php_getopt()). (Stas)
|
||||
. Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
|
||||
. Fixed bug #68129 (parse_url() - incomplete support for empty usernames
|
||||
and passwords) (Tjerk)
|
||||
Fixed bug #68365 (zend_mm_heap corrupted after memory overflow in
|
||||
zend_hash_copy). (Dmitry)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
|
||||
. Fixed bug #68283 (fileinfo: out-of-bounds read in elf note headers).
|
||||
(CVE-2014-3710) (Remi)
|
||||
|
||||
- FPM:
|
||||
. Implemented FR #55508 (listen and listen.allowed_clients should take IPv6
|
||||
addresses). (Robin Gloster)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #65171 (imagescale() fails without height param). (Remi)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #63595 (GMP memory management conflicts with other libraries
|
||||
using GMP). (Remi)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #68114 (linker error on some OS X machines with fixed width
|
||||
decimal support) (Keyur Govande)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #68087 (ODBC not correctly reading DATE column when preceded by
|
||||
a VARCHAR column) (Keyur Govande)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk)
|
||||
|
||||
- CURL:
|
||||
. Add CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, and
|
||||
CURL_SSLVERSION_TLSv1_2 constants if supported by libcurl (Rasmus)
|
||||
|
||||
16 Oct 2014, PHP 5.5.18
|
||||
|
||||
- Core:
|
||||
. Fixed bug #67985 (Incorrect last used array index copied to new array after
|
||||
unset). (Tjerk)
|
||||
. Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
|
||||
as 6.2 (instead of 6.3)). (Christian Wenz)
|
||||
. Fixed bug #67633 (A foreach on an array returned from a function not doing
|
||||
copy-on-write). (Nikita)
|
||||
. Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable
|
||||
when using Apache, mod_proxy-fcgi and ProxyPass). (Remi)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #67972 (SessionHandler Invalid memory read create_sid()). (Adam)
|
||||
|
||||
18 Sep 2014, PHP 5.5.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #47358 (glob returns error, should be empty array()). (Pierre)
|
||||
. Fixed bug #65463 (SIGSEGV during zend_shutdown()). (Keyur Govande)
|
||||
. Fixed bug #66036 (Crash on SIGTERM in apache process). (Keyur Govande)
|
||||
. Fixed bug #67878 (program_prefix not honoured in man pages). (Remi)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #41577 (DOTNET is successful once per server run)
|
||||
(Aidas Kasparas)
|
||||
|
||||
- FPM:
|
||||
. Fixed #67606 (FPM with mod_fastcgi/apache2.4 is broken). (David Zuelke)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads).
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #67850 (extension won't build if openssl compiled without SSLv3)
|
||||
(Daniel Lowrey)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException
|
||||
wrong message). (tim_siebels_aurich at yahoo dot de)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66091 (memory leaks in DateTime constructor). (Tjerk)
|
||||
. Fixed bug #66985 (Some timezones are no longer valid in PHP 5.5.10).
|
||||
(Derick)
|
||||
. Fixed bug #67109 (First uppercase letter breaks date string parsing).
|
||||
(Derick)
|
||||
|
||||
- GD
|
||||
. Made fontFetch's path parser thread-safe. (Sara).
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #67839 (mysqli does not handle 4-byte floats correctly). (Keyur)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
|
||||
data). (Mike)
|
||||
. Fixed bug #67865 (internal corruption phar error). Mike
|
||||
|
||||
21 Aug 2014, PHP 5.5.16
|
||||
|
||||
- COM:
|
||||
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
|
||||
@@ -8,6 +114,7 @@ PHP NEWS
|
||||
- Fileinfo:
|
||||
. Fixed bug #67705 (extensive backtracking in rule regular expression).
|
||||
(CVE-2014-3538) (Remi)
|
||||
. Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
|
||||
@@ -16,12 +123,17 @@ PHP NEWS
|
||||
- GD:
|
||||
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
|
||||
(CVE-2014-2497) (Remi)
|
||||
. Fixed bug #67730 (Null byte injection possible with imagexxx functions).
|
||||
(CVE-2014-5120) (Ryan Mauger)
|
||||
|
||||
- Milter:
|
||||
. Fixed bug #67715 (php-milter does not build and crashes randomly). (Mike)
|
||||
|
||||
- Network:
|
||||
. Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597) (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed missing type checks in OpenSSL options (Yussuf Khalil, Stas).
|
||||
. Fixed missing type checks in OpenSSL options. (Yussuf Khalil, Stas)
|
||||
|
||||
- readline:
|
||||
. Fixed bug #55496 (Interactive mode doesn't force a newline before the
|
||||
@@ -39,10 +151,6 @@ PHP NEWS
|
||||
. Fixed bug #60616 (odbc_fetch_into returns junk data at end of multi-byte
|
||||
char fields). (Keyur)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
|
||||
data). (Mike)
|
||||
|
||||
24 Jul 2014, PHP 5.5.15
|
||||
|
||||
- Core:
|
||||
@@ -155,6 +263,8 @@ PHP NEWS
|
||||
. Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
|
||||
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
|
||||
. Fixed bug #67360 (Missing element after ArrayObject::getIterator). (Adam)
|
||||
. Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
|
||||
Confusion). (CVE-2014-3515) (Stefan Esser)
|
||||
|
||||
29 May 2014, PHP 5.5.13
|
||||
|
||||
|
||||
+8
-4
@@ -45,15 +45,16 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
@@ -61,9 +62,12 @@ Currently we have the following branches in use::
|
||||
|
||||
PHP-4.4 This branch is closed.
|
||||
|
||||
PHP-X.Y.Z These branches are used for the release managers for tagging
|
||||
the releases, hence they are closed to the general public.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.3) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function id($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function &ref_id(&$x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$c = 'c';
|
||||
$array = ['a', 'b', $c];
|
||||
|
||||
foreach(id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
foreach(ref_id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "aq"
|
||||
[1]=>
|
||||
string(2) "bq"
|
||||
[2]=>
|
||||
&string(2) "cq"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #67985 - Last used array index not copied to new array at assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = ['zero', 'one', 'two'];
|
||||
unset($a[2]);
|
||||
$b = $a;
|
||||
$a[] = 'three';
|
||||
$b[] = 'three';
|
||||
|
||||
var_dump($a === $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
$obj = new stdClass;
|
||||
$obj->test = 'meow';
|
||||
return true;
|
||||
});
|
||||
|
||||
$a = new stdClass;
|
||||
$a->undefined .= 'test';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["undefined"]=>
|
||||
string(4) "test"
|
||||
}
|
||||
+14
@@ -814,6 +814,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
|
||||
|
||||
if (EG(active))
|
||||
{
|
||||
/*
|
||||
* The order of destruction is important here.
|
||||
* See bugs #65463 and 66036.
|
||||
*/
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC);
|
||||
zend_cleanup_internal_classes(TSRMLS_C);
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_destroy_modules();
|
||||
|
||||
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
|
||||
|
||||
@@ -6231,6 +6231,15 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
/* save the location of FETCH_W instruction(s) */
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
|
||||
|
||||
if (zend_is_function_or_method_call(array)) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_SEPARATE;
|
||||
SET_NODE(opline->op1, array);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->result_type = IS_VAR;
|
||||
opline->result.var = opline->op1.var;
|
||||
}
|
||||
} else {
|
||||
is_variable = 0;
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
@@ -666,6 +666,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
|
||||
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
|
||||
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
|
||||
ZEND_API void zend_function_dtor(zend_function *function);
|
||||
|
||||
@@ -109,7 +109,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
|
||||
@@ -754,9 +754,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
|
||||
/* we don't have access controls - will just add it */
|
||||
new_zval = &EG(uninitialized_zval);
|
||||
|
||||
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
|
||||
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
|
||||
}
|
||||
Z_ADDREF_P(new_zval);
|
||||
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
|
||||
property_info->offset >= 0) {
|
||||
@@ -776,6 +773,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
|
||||
}
|
||||
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval);
|
||||
}
|
||||
|
||||
/* Notice is thrown after creation of the property, to avoid EG(std_property_info)
|
||||
* being overwritten in an error handler. */
|
||||
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
|
||||
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
|
||||
}
|
||||
} else {
|
||||
/* we do have getter - fail and let it try again with usual get/set */
|
||||
retval = NULL;
|
||||
|
||||
@@ -135,8 +135,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
}
|
||||
ALLOC_HASHTABLE_REL(tmp_ht);
|
||||
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zvalue->value.ht = tmp_ht;
|
||||
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
|
||||
+1
-1
@@ -2800,7 +2800,7 @@ AC_DEFUN([PHP_DETECT_ICC],
|
||||
|
||||
dnl PHP_DETECT_SUNCC
|
||||
dnl Detect if the systems default compiler is suncc.
|
||||
dnl We also set some usefull CFLAGS if the user didn't set any
|
||||
dnl We also set some useful CFLAGS if the user didn't set any
|
||||
AC_DEFUN([PHP_DETECT_SUNCC],[
|
||||
SUNCC="no"
|
||||
AC_MSG_CHECKING([for suncc])
|
||||
|
||||
Vendored
+9
-3
@@ -615,7 +615,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@@ -629,7 +629,10 @@ s390*-*linux*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
ppc64-*linux*|powerpc64-*linux*)
|
||||
powerpc64le-*linux*)
|
||||
LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@@ -648,7 +651,10 @@ s390*-*linux*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
ppc*-*linux*|powerpc*-*linux*)
|
||||
powerpcle-*linux*)
|
||||
LD="${LD-ld} -m elf64lppc"
|
||||
;;
|
||||
powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*)
|
||||
|
||||
Vendored
+6
@@ -982,6 +982,12 @@ EOF
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit ;;
|
||||
|
||||
+24
-10
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=5
|
||||
PHP_RELEASE_VERSION=15
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -784,7 +784,12 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
|
||||
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
|
||||
ltp_version_min="105"
|
||||
dnl non-working versions, e.g. "1.8 1.18";
|
||||
dnl remove "none" when introducing the first incompatible LTP version an
|
||||
dnl separate any following additions by spaces
|
||||
ltp_version_exclude="1.8"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
@@ -794,21 +799,30 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
if test "$LTP"; then
|
||||
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
|
||||
php_cv_ltp_version=invalid
|
||||
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
||||
for ltp_check_version in $ltp_version_list; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
php_cv_ltp_version="$ltp_check_version (ok)"
|
||||
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
|
||||
if test -n "$ltp_version_vars"; then
|
||||
set $ltp_version_vars
|
||||
ltp_version="${1}.${2}"
|
||||
ltp_version_num="`expr ${1} \* 100 + ${2}`"
|
||||
if test $ltp_version_num -ge $ltp_version_min; then
|
||||
php_cv_ltp_version="$ltp_version (ok)"
|
||||
for ltp_check_version in $ltp_version_exclude; do
|
||||
if test "$ltp_version" = "$ltp_check_version"; then
|
||||
php_cv_ltp_version=invalid
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
else
|
||||
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
|
||||
ltp_msg="To enable code coverage reporting you must have LTP installed"
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
fi
|
||||
|
||||
case $php_cv_ltp_version in
|
||||
""|invalid[)]
|
||||
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
|
||||
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
|
||||
AC_MSG_ERROR([$ltp_msg])
|
||||
LTP="exit 0;"
|
||||
;;
|
||||
|
||||
@@ -198,7 +198,8 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
IUnknown *unk = NULL;
|
||||
|
||||
php_com_initialize(TSRMLS_C);
|
||||
if (COMG(dotnet_runtime_stuff) == NULL) {
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
if (stuff == NULL) {
|
||||
hr = dotnet_init(&where TSRMLS_CC);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
@@ -210,9 +211,35 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
}
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
|
||||
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
|
||||
} else if (stuff->dotnet_domain == NULL) {
|
||||
where = "ICorRuntimeHost_GetDefaultDomain";
|
||||
hr = ICorRuntimeHost_GetDefaultDomain(stuff->dotnet_host, &unk);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
|
||||
if (err)
|
||||
LocalFree(err);
|
||||
php_com_throw_exception(hr, buf TSRMLS_CC);
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
|
||||
where = "QI: System._AppDomain";
|
||||
hr = IUnknown_QueryInterface(unk, &IID_mscorlib_System_AppDomain, (LPVOID*)&stuff->dotnet_domain);
|
||||
if (FAILED(hr)) {
|
||||
char buf[1024];
|
||||
char *err = php_win32_error_to_msg(hr);
|
||||
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
|
||||
if (err)
|
||||
LocalFree(err);
|
||||
php_com_throw_exception(hr, buf TSRMLS_CC);
|
||||
ZVAL_NULL(object);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
|
||||
@@ -169,6 +169,11 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
|
||||
{
|
||||
CURLcode error = CURLE_OK;
|
||||
|
||||
if (strlen(str) != len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
if (make_copy) {
|
||||
#endif
|
||||
@@ -1197,6 +1202,12 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */
|
||||
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0);
|
||||
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1);
|
||||
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2);
|
||||
#endif
|
||||
|
||||
#if CURLOPT_FTPASCII != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #68089 (NULL byte injection - cURL lib)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$url = "file:///etc/passwd\0http://google.com";
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_URL, $url));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
|
||||
bool(false)
|
||||
Done
|
||||
@@ -28,7 +28,7 @@ Features
|
||||
AsynchDNS => Yes
|
||||
CharConv => No
|
||||
Debug => No
|
||||
GSS-Negotiate => Yes
|
||||
GSS-Negotiate => No
|
||||
IDN => Yes
|
||||
IPv6 => Yes
|
||||
krb4 => No
|
||||
|
||||
+110
-136
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Jul 31 14:33:37 2014 */
|
||||
/* Generated by re2c 0.13.5 on Mon Aug 18 18:28:27 2014 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -670,7 +670,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
|
||||
}
|
||||
}
|
||||
|
||||
const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
|
||||
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
|
||||
{
|
||||
int first_found = 0;
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
@@ -698,25 +698,6 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -727,7 +708,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
{
|
||||
char *word;
|
||||
char *begin = *ptr, *end;
|
||||
@@ -741,7 +722,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
word = calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
if ((tp = zone_search(word, -1, 0))) {
|
||||
if ((tp = abbr_search(word, -1, 0))) {
|
||||
value = -tp->gmtoffset / 60;
|
||||
*dst = tp->type;
|
||||
value += tp->type * 60;
|
||||
@@ -785,33 +766,26 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
retval = timelib_parse_tz_cor(ptr);
|
||||
} else {
|
||||
int found = 0;
|
||||
long offset;
|
||||
long offset = 0;
|
||||
char *tz_abbr;
|
||||
|
||||
t->is_localtime = 1;
|
||||
|
||||
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
|
||||
/* First, we lookup by abbreviation only */
|
||||
offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
|
||||
if (found) {
|
||||
t->zone_type = TIMELIB_ZONETYPE_ABBR;
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
#if 0
|
||||
/* If we found a TimeZone identifier, use it */
|
||||
if (tz_name) {
|
||||
t->tz_info = timelib_parse_tzfile(tz_name);
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
}
|
||||
#endif
|
||||
/* If we have a TimeZone identifier to start with, use it */
|
||||
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
|
||||
|
||||
/* Otherwise, we look if we have a TimeZone identifier */
|
||||
if (!found || strcmp("UTC", tz_abbr) == 0) {
|
||||
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
|
||||
t->tz_info = res;
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
found++;
|
||||
}
|
||||
}
|
||||
if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
free(tz_abbr);
|
||||
*tz_not_found = (found == 0);
|
||||
retval = offset;
|
||||
@@ -840,11 +814,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 966 "ext/date/lib/parse_date.re"
|
||||
#line 940 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 848 "ext/date/lib/parse_date.c"
|
||||
#line 822 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -984,7 +958,7 @@ yy2:
|
||||
}
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
#line 1646 "ext/date/lib/parse_date.re"
|
||||
#line 1620 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -997,7 +971,7 @@ yy3:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1001 "ext/date/lib/parse_date.c"
|
||||
#line 975 "ext/date/lib/parse_date.c"
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1308,12 +1282,12 @@ yy11:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy12:
|
||||
YYDEBUG(12, *YYCURSOR);
|
||||
#line 1741 "ext/date/lib/parse_date.re"
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1317 "ext/date/lib/parse_date.c"
|
||||
#line 1291 "ext/date/lib/parse_date.c"
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2370,11 +2344,11 @@ yy48:
|
||||
if (yych <= '9') goto yy54;
|
||||
yy49:
|
||||
YYDEBUG(49, *YYCURSOR);
|
||||
#line 1730 "ext/date/lib/parse_date.re"
|
||||
#line 1704 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2378 "ext/date/lib/parse_date.c"
|
||||
#line 2352 "ext/date/lib/parse_date.c"
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2383,12 +2357,12 @@ yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
#line 1735 "ext/date/lib/parse_date.re"
|
||||
#line 1709 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2392 "ext/date/lib/parse_date.c"
|
||||
#line 2366 "ext/date/lib/parse_date.c"
|
||||
yy53:
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2775,7 +2749,7 @@ yy71:
|
||||
if (yych == 's') goto yy73;
|
||||
yy72:
|
||||
YYDEBUG(72, *YYCURSOR);
|
||||
#line 1714 "ext/date/lib/parse_date.re"
|
||||
#line 1688 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2790,7 +2764,7 @@ yy72:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2794 "ext/date/lib/parse_date.c"
|
||||
#line 2768 "ext/date/lib/parse_date.c"
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3552,7 +3526,7 @@ yy165:
|
||||
}
|
||||
yy166:
|
||||
YYDEBUG(166, *YYCURSOR);
|
||||
#line 1577 "ext/date/lib/parse_date.re"
|
||||
#line 1551 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3569,7 +3543,7 @@ yy166:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3573 "ext/date/lib/parse_date.c"
|
||||
#line 3547 "ext/date/lib/parse_date.c"
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4089,7 +4063,7 @@ yy192:
|
||||
}
|
||||
yy193:
|
||||
YYDEBUG(193, *YYCURSOR);
|
||||
#line 1636 "ext/date/lib/parse_date.re"
|
||||
#line 1610 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4098,7 +4072,7 @@ yy193:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4102 "ext/date/lib/parse_date.c"
|
||||
#line 4076 "ext/date/lib/parse_date.c"
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4149,7 +4123,7 @@ yy197:
|
||||
}
|
||||
yy198:
|
||||
YYDEBUG(198, *YYCURSOR);
|
||||
#line 1382 "ext/date/lib/parse_date.re"
|
||||
#line 1356 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4162,7 +4136,7 @@ yy198:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4166 "ext/date/lib/parse_date.c"
|
||||
#line 4140 "ext/date/lib/parse_date.c"
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4431,7 +4405,7 @@ yy221:
|
||||
}
|
||||
yy222:
|
||||
YYDEBUG(222, *YYCURSOR);
|
||||
#line 1684 "ext/date/lib/parse_date.re"
|
||||
#line 1658 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4460,7 +4434,7 @@ yy222:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4464 "ext/date/lib/parse_date.c"
|
||||
#line 4438 "ext/date/lib/parse_date.c"
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5158,7 +5132,7 @@ yy277:
|
||||
YYDEBUG(277, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
#line 1660 "ext/date/lib/parse_date.re"
|
||||
#line 1634 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5181,7 +5155,7 @@ yy277:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5185 "ext/date/lib/parse_date.c"
|
||||
#line 5159 "ext/date/lib/parse_date.c"
|
||||
yy279:
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5359,7 +5333,7 @@ yy293:
|
||||
++YYCURSOR;
|
||||
yy294:
|
||||
YYDEBUG(294, *YYCURSOR);
|
||||
#line 1354 "ext/date/lib/parse_date.re"
|
||||
#line 1328 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5372,7 +5346,7 @@ yy294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5376 "ext/date/lib/parse_date.c"
|
||||
#line 5350 "ext/date/lib/parse_date.c"
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6592,7 +6566,7 @@ yy361:
|
||||
if (yych <= '9') goto yy364;
|
||||
yy363:
|
||||
YYDEBUG(363, *YYCURSOR);
|
||||
#line 1498 "ext/date/lib/parse_date.re"
|
||||
#line 1472 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6605,7 +6579,7 @@ yy363:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6609 "ext/date/lib/parse_date.c"
|
||||
#line 6583 "ext/date/lib/parse_date.c"
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7243,7 +7217,7 @@ yy391:
|
||||
}
|
||||
yy392:
|
||||
YYDEBUG(392, *YYCURSOR);
|
||||
#line 1556 "ext/date/lib/parse_date.re"
|
||||
#line 1530 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7263,7 +7237,7 @@ yy392:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7267 "ext/date/lib/parse_date.c"
|
||||
#line 7241 "ext/date/lib/parse_date.c"
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -9013,7 +8987,7 @@ yy453:
|
||||
++YYCURSOR;
|
||||
yy454:
|
||||
YYDEBUG(454, *YYCURSOR);
|
||||
#line 1259 "ext/date/lib/parse_date.re"
|
||||
#line 1233 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9024,7 +8998,7 @@ yy454:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9028 "ext/date/lib/parse_date.c"
|
||||
#line 9002 "ext/date/lib/parse_date.c"
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9584,7 +9558,7 @@ yy474:
|
||||
}
|
||||
yy475:
|
||||
YYDEBUG(475, *YYCURSOR);
|
||||
#line 1396 "ext/date/lib/parse_date.re"
|
||||
#line 1370 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9595,7 +9569,7 @@ yy475:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9599 "ext/date/lib/parse_date.c"
|
||||
#line 9573 "ext/date/lib/parse_date.c"
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9736,7 +9710,7 @@ yy487:
|
||||
YYDEBUG(487, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
#line 1114 "ext/date/lib/parse_date.re"
|
||||
#line 1088 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9752,7 +9726,7 @@ yy487:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9756 "ext/date/lib/parse_date.c"
|
||||
#line 9730 "ext/date/lib/parse_date.c"
|
||||
yy489:
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9765,7 +9739,7 @@ yy489:
|
||||
}
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
#line 1151 "ext/date/lib/parse_date.re"
|
||||
#line 1125 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9790,7 +9764,7 @@ yy490:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9794 "ext/date/lib/parse_date.c"
|
||||
#line 9768 "ext/date/lib/parse_date.c"
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10100,7 +10074,7 @@ yy522:
|
||||
YYDEBUG(522, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
#line 1131 "ext/date/lib/parse_date.re"
|
||||
#line 1105 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10119,7 +10093,7 @@ yy522:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10123 "ext/date/lib/parse_date.c"
|
||||
#line 10097 "ext/date/lib/parse_date.c"
|
||||
yy524:
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10225,7 +10199,7 @@ yy533:
|
||||
if (yych <= '9') goto yy540;
|
||||
yy534:
|
||||
YYDEBUG(534, *YYCURSOR);
|
||||
#line 1313 "ext/date/lib/parse_date.re"
|
||||
#line 1287 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -10239,7 +10213,7 @@ yy534:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10243 "ext/date/lib/parse_date.c"
|
||||
#line 10217 "ext/date/lib/parse_date.c"
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -10976,7 +10950,7 @@ yy604:
|
||||
YYDEBUG(605, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
#line 1328 "ext/date/lib/parse_date.re"
|
||||
#line 1302 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -10987,7 +10961,7 @@ yy604:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 10991 "ext/date/lib/parse_date.c"
|
||||
#line 10965 "ext/date/lib/parse_date.c"
|
||||
yy607:
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11023,7 +10997,7 @@ yy610:
|
||||
if (yych <= '9') goto yy604;
|
||||
yy611:
|
||||
YYDEBUG(611, *YYCURSOR);
|
||||
#line 1340 "ext/date/lib/parse_date.re"
|
||||
#line 1314 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11036,7 +11010,7 @@ yy611:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11040 "ext/date/lib/parse_date.c"
|
||||
#line 11014 "ext/date/lib/parse_date.c"
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11677,7 +11651,7 @@ yy655:
|
||||
}
|
||||
yy656:
|
||||
YYDEBUG(656, *YYCURSOR);
|
||||
#line 1299 "ext/date/lib/parse_date.re"
|
||||
#line 1273 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11690,7 +11664,7 @@ yy656:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11694 "ext/date/lib/parse_date.c"
|
||||
#line 11668 "ext/date/lib/parse_date.c"
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11796,7 +11770,7 @@ yy665:
|
||||
}
|
||||
yy666:
|
||||
YYDEBUG(666, *YYCURSOR);
|
||||
#line 1243 "ext/date/lib/parse_date.re"
|
||||
#line 1217 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11811,7 +11785,7 @@ yy666:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11815 "ext/date/lib/parse_date.c"
|
||||
#line 11789 "ext/date/lib/parse_date.c"
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12044,7 +12018,7 @@ yy699:
|
||||
if (yych <= ':') goto yy703;
|
||||
yy700:
|
||||
YYDEBUG(700, *YYCURSOR);
|
||||
#line 1526 "ext/date/lib/parse_date.re"
|
||||
#line 1500 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12064,7 +12038,7 @@ yy700:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12068 "ext/date/lib/parse_date.c"
|
||||
#line 12042 "ext/date/lib/parse_date.c"
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12616,7 +12590,7 @@ yy762:
|
||||
}
|
||||
yy763:
|
||||
YYDEBUG(763, *YYCURSOR);
|
||||
#line 1271 "ext/date/lib/parse_date.re"
|
||||
#line 1245 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12629,7 +12603,7 @@ yy763:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12633 "ext/date/lib/parse_date.c"
|
||||
#line 12607 "ext/date/lib/parse_date.c"
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12668,7 +12642,7 @@ yy770:
|
||||
YYDEBUG(770, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
#line 1512 "ext/date/lib/parse_date.re"
|
||||
#line 1486 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12681,7 +12655,7 @@ yy770:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12685 "ext/date/lib/parse_date.c"
|
||||
#line 12659 "ext/date/lib/parse_date.c"
|
||||
yy772:
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12819,7 +12793,7 @@ yy782:
|
||||
}
|
||||
yy783:
|
||||
YYDEBUG(783, *YYCURSOR);
|
||||
#line 1547 "ext/date/lib/parse_date.re"
|
||||
#line 1521 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12827,7 +12801,7 @@ yy783:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12831 "ext/date/lib/parse_date.c"
|
||||
#line 12805 "ext/date/lib/parse_date.c"
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12978,7 +12952,7 @@ yy792:
|
||||
}
|
||||
yy793:
|
||||
YYDEBUG(793, *YYCURSOR);
|
||||
#line 1368 "ext/date/lib/parse_date.re"
|
||||
#line 1342 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -12991,7 +12965,7 @@ yy793:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 12995 "ext/date/lib/parse_date.c"
|
||||
#line 12969 "ext/date/lib/parse_date.c"
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13206,7 +13180,7 @@ yy813:
|
||||
if (yych <= '7') goto yy816;
|
||||
yy814:
|
||||
YYDEBUG(814, *YYCURSOR);
|
||||
#line 1479 "ext/date/lib/parse_date.re"
|
||||
#line 1453 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13224,7 +13198,7 @@ yy814:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13228 "ext/date/lib/parse_date.c"
|
||||
#line 13202 "ext/date/lib/parse_date.c"
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13234,7 +13208,7 @@ yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
#line 1460 "ext/date/lib/parse_date.re"
|
||||
#line 1434 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13252,7 +13226,7 @@ yy816:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13256 "ext/date/lib/parse_date.c"
|
||||
#line 13230 "ext/date/lib/parse_date.c"
|
||||
yy818:
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13316,7 +13290,7 @@ yy820:
|
||||
}
|
||||
yy821:
|
||||
YYDEBUG(821, *YYCURSOR);
|
||||
#line 1446 "ext/date/lib/parse_date.re"
|
||||
#line 1420 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13329,7 +13303,7 @@ yy821:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13333 "ext/date/lib/parse_date.c"
|
||||
#line 13307 "ext/date/lib/parse_date.c"
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13432,7 +13406,7 @@ yy841:
|
||||
++YYCURSOR;
|
||||
yy842:
|
||||
YYDEBUG(842, *YYCURSOR);
|
||||
#line 1420 "ext/date/lib/parse_date.re"
|
||||
#line 1394 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13457,7 +13431,7 @@ yy842:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13461 "ext/date/lib/parse_date.c"
|
||||
#line 13435 "ext/date/lib/parse_date.c"
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13719,7 +13693,7 @@ yy847:
|
||||
}
|
||||
yy848:
|
||||
YYDEBUG(848, *YYCURSOR);
|
||||
#line 1408 "ext/date/lib/parse_date.re"
|
||||
#line 1382 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13730,7 +13704,7 @@ yy848:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13734 "ext/date/lib/parse_date.c"
|
||||
#line 13708 "ext/date/lib/parse_date.c"
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14650,7 +14624,7 @@ yy972:
|
||||
if (yych <= '9') goto yy995;
|
||||
yy973:
|
||||
YYDEBUG(973, *YYCURSOR);
|
||||
#line 1285 "ext/date/lib/parse_date.re"
|
||||
#line 1259 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -14663,7 +14637,7 @@ yy973:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14667 "ext/date/lib/parse_date.c"
|
||||
#line 14641 "ext/date/lib/parse_date.c"
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15672,7 +15646,7 @@ yy1065:
|
||||
}
|
||||
yy1067:
|
||||
YYDEBUG(1067, *YYCURSOR);
|
||||
#line 1177 "ext/date/lib/parse_date.re"
|
||||
#line 1151 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15694,7 +15668,7 @@ yy1067:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15698 "ext/date/lib/parse_date.c"
|
||||
#line 15672 "ext/date/lib/parse_date.c"
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15786,7 +15760,7 @@ yy1074:
|
||||
}
|
||||
yy1075:
|
||||
YYDEBUG(1075, *YYCURSOR);
|
||||
#line 1223 "ext/date/lib/parse_date.re"
|
||||
#line 1197 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15805,7 +15779,7 @@ yy1075:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15809 "ext/date/lib/parse_date.c"
|
||||
#line 15783 "ext/date/lib/parse_date.c"
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16703,7 +16677,7 @@ yy1116:
|
||||
}
|
||||
yy1117:
|
||||
YYDEBUG(1117, *YYCURSOR);
|
||||
#line 1619 "ext/date/lib/parse_date.re"
|
||||
#line 1593 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16719,7 +16693,7 @@ yy1117:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16723 "ext/date/lib/parse_date.c"
|
||||
#line 16697 "ext/date/lib/parse_date.c"
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16770,7 +16744,7 @@ yy1125:
|
||||
YYDEBUG(1125, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
#line 1092 "ext/date/lib/parse_date.re"
|
||||
#line 1066 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16791,7 +16765,7 @@ yy1125:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16795 "ext/date/lib/parse_date.c"
|
||||
#line 16769 "ext/date/lib/parse_date.c"
|
||||
yy1127:
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16899,7 +16873,7 @@ yy1140:
|
||||
}
|
||||
yy1141:
|
||||
YYDEBUG(1141, *YYCURSOR);
|
||||
#line 1595 "ext/date/lib/parse_date.re"
|
||||
#line 1569 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16922,7 +16896,7 @@ yy1141:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16926 "ext/date/lib/parse_date.c"
|
||||
#line 16900 "ext/date/lib/parse_date.c"
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19599,7 +19573,7 @@ yy1293:
|
||||
goto yy1297;
|
||||
yy1294:
|
||||
YYDEBUG(1294, *YYCURSOR);
|
||||
#line 1069 "ext/date/lib/parse_date.re"
|
||||
#line 1043 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19621,7 +19595,7 @@ yy1294:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19625 "ext/date/lib/parse_date.c"
|
||||
#line 19599 "ext/date/lib/parse_date.c"
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -19882,14 +19856,14 @@ yy1315:
|
||||
YYDEBUG(1315, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1316, *YYCURSOR);
|
||||
#line 1052 "ext/date/lib/parse_date.re"
|
||||
#line 1026 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_RELATIVE();
|
||||
|
||||
/* skip "last day of" or "first day of" */
|
||||
if (*ptr == 'l') {
|
||||
if (*ptr == 'l' || *ptr == 'L') {
|
||||
s->time->relative.first_last_day_of = 2;
|
||||
} else {
|
||||
s->time->relative.first_last_day_of = 1;
|
||||
@@ -19898,7 +19872,7 @@ yy1315:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19902 "ext/date/lib/parse_date.c"
|
||||
#line 19876 "ext/date/lib/parse_date.c"
|
||||
yy1317:
|
||||
YYDEBUG(1317, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -21329,7 +21303,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1026 "ext/date/lib/parse_date.re"
|
||||
#line 1000 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21354,7 +21328,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21358 "ext/date/lib/parse_date.c"
|
||||
#line 21332 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21790,7 +21764,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1014 "ext/date/lib/parse_date.re"
|
||||
#line 988 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21801,7 +21775,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21805 "ext/date/lib/parse_date.c"
|
||||
#line 21779 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21836,7 +21810,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1004 "ext/date/lib/parse_date.re"
|
||||
#line 978 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21845,7 +21819,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21849 "ext/date/lib/parse_date.c"
|
||||
#line 21823 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23857,7 +23831,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 983 "ext/date/lib/parse_date.re"
|
||||
#line 957 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23865,7 +23839,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23869 "ext/date/lib/parse_date.c"
|
||||
#line 23843 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -24004,7 +23978,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 992 "ext/date/lib/parse_date.re"
|
||||
#line 966 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -24015,7 +23989,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24019 "ext/date/lib/parse_date.c"
|
||||
#line 23993 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24548,7 +24522,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 971 "ext/date/lib/parse_date.re"
|
||||
#line 945 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24559,7 +24533,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24563 "ext/date/lib/parse_date.c"
|
||||
#line 24537 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24732,7 +24706,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
#line 1719 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -25223,7 +25197,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
|
||||
{
|
||||
const timelib_tz_lookup_table *tp;
|
||||
|
||||
tp = zone_search(abbr, gmtoffset, isdst);
|
||||
tp = abbr_search(abbr, gmtoffset, isdst);
|
||||
if (tp) {
|
||||
return (tp->full_tz_name);
|
||||
} else {
|
||||
|
||||
+12
-38
@@ -668,7 +668,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
|
||||
}
|
||||
}
|
||||
|
||||
const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
|
||||
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
|
||||
{
|
||||
int first_found = 0;
|
||||
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
|
||||
@@ -696,25 +696,6 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -725,7 +706,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
|
||||
{
|
||||
char *word;
|
||||
char *begin = *ptr, *end;
|
||||
@@ -739,7 +720,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
word = calloc(1, end - begin + 1);
|
||||
memcpy(word, begin, end - begin);
|
||||
|
||||
if ((tp = zone_search(word, -1, 0))) {
|
||||
if ((tp = abbr_search(word, -1, 0))) {
|
||||
value = -tp->gmtoffset / 60;
|
||||
*dst = tp->type;
|
||||
value += tp->type * 60;
|
||||
@@ -783,33 +764,26 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
|
||||
retval = timelib_parse_tz_cor(ptr);
|
||||
} else {
|
||||
int found = 0;
|
||||
long offset;
|
||||
long offset = 0;
|
||||
char *tz_abbr;
|
||||
|
||||
t->is_localtime = 1;
|
||||
|
||||
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
|
||||
/* First, we lookup by abbreviation only */
|
||||
offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
|
||||
if (found) {
|
||||
t->zone_type = TIMELIB_ZONETYPE_ABBR;
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
#if 0
|
||||
/* If we found a TimeZone identifier, use it */
|
||||
if (tz_name) {
|
||||
t->tz_info = timelib_parse_tzfile(tz_name);
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
}
|
||||
#endif
|
||||
/* If we have a TimeZone identifier to start with, use it */
|
||||
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
|
||||
|
||||
/* Otherwise, we look if we have a TimeZone identifier */
|
||||
if (!found || strcmp("UTC", tz_abbr) == 0) {
|
||||
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
|
||||
t->tz_info = res;
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
found++;
|
||||
}
|
||||
}
|
||||
if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
|
||||
timelib_time_tz_abbr_update(t, tz_abbr);
|
||||
}
|
||||
free(tz_abbr);
|
||||
*tz_not_found = (found == 0);
|
||||
retval = offset;
|
||||
@@ -1055,7 +1029,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
TIMELIB_HAVE_RELATIVE();
|
||||
|
||||
/* skip "last day of" or "first day of" */
|
||||
if (*ptr == 'l') {
|
||||
if (*ptr == 'l' || *ptr == 'L') {
|
||||
s->time->relative.first_last_day_of = 2;
|
||||
} else {
|
||||
s->time->relative.first_last_day_of = 1;
|
||||
@@ -2232,7 +2206,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
|
||||
{
|
||||
const timelib_tz_lookup_table *tp;
|
||||
|
||||
tp = zone_search(abbr, gmtoffset, isdst);
|
||||
tp = abbr_search(abbr, gmtoffset, isdst);
|
||||
if (tp) {
|
||||
return (tp->full_tz_name);
|
||||
} else {
|
||||
|
||||
+1571
-1495
File diff suppressed because it is too large.
Load diff
+36
-20
@@ -326,7 +326,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, datetime)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
|
||||
@@ -2534,11 +2534,7 @@ static void date_object_free_storage_period(void *object TSRMLS_DC)
|
||||
/* Advanced Interface */
|
||||
PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
|
||||
{
|
||||
Z_TYPE_P(object) = IS_OBJECT;
|
||||
object_init_ex(object, pce);
|
||||
Z_SET_REFCOUNT_P(object, 1);
|
||||
Z_UNSET_ISREF_P(object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -2646,14 +2642,19 @@ PHP_FUNCTION(date_create)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL;
|
||||
int time_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2666,14 +2667,19 @@ PHP_FUNCTION(date_create_immutable)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL;
|
||||
int time_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2686,14 +2692,19 @@ PHP_FUNCTION(date_create_from_format)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL, *format_str = NULL;
|
||||
int time_str_len = 0, format_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2706,14 +2717,19 @@ PHP_FUNCTION(date_create_immutable_from_format)
|
||||
zval *timezone_object = NULL;
|
||||
char *time_str = NULL, *format_str = NULL;
|
||||
int time_str_len = 0, format_str_len = 0;
|
||||
zval datetime_object;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
|
||||
if (!php_date_initialize(zend_object_store_get_object(&datetime_object TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
|
||||
zval_dtor(&datetime_object);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
zval *datetime_object_ptr = &datetime_object;
|
||||
RETVAL_ZVAL(datetime_object_ptr, 0, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2754,7 +2770,7 @@ PHP_METHOD(DateTimeImmutable, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
|
||||
static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
zval **z_date = NULL;
|
||||
zval **z_timezone = NULL;
|
||||
@@ -2824,7 +2840,7 @@ PHP_METHOD(DateTime, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
}
|
||||
@@ -2846,7 +2862,7 @@ PHP_METHOD(DateTimeImmutable, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object");
|
||||
}
|
||||
}
|
||||
@@ -2864,7 +2880,7 @@ PHP_METHOD(DateTime, __wakeup)
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
}
|
||||
@@ -3807,7 +3823,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object)
|
||||
/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object)
|
||||
Returns the timezone offset.
|
||||
*/
|
||||
PHP_FUNCTION(timezone_offset_get)
|
||||
@@ -3817,13 +3833,13 @@ PHP_FUNCTION(timezone_offset_get)
|
||||
php_date_obj *dateobj;
|
||||
timelib_time_offset *offset;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
|
||||
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
|
||||
DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface);
|
||||
|
||||
switch (tzobj->type) {
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
DateTimeZone::getOffset() accepts a DateTimeInterface object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tz = new DateTimeZone('Europe/London');
|
||||
$dt = new DateTimeImmutable('2014-09-20', $tz);
|
||||
|
||||
echo $tz->getOffset($dt);
|
||||
echo $tz->getOffset(1);
|
||||
--EXPECTF--
|
||||
3600
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s
|
||||
@@ -112,141 +112,141 @@ fclose( $file_handle );
|
||||
|
||||
-- int 0 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int 1 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int 12345 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int -12345 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float 10.5 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float -10.5 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float .5 --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty array --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int indexed array --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- associative array --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- nested arrays --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase NULL --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase null --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase true --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase false --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase TRUE --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase FALSE --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty string DQ --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty string SQ --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- string DQ --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- string SQ --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- mixed case string --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- heredoc --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- instance of classWithToString --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- instance of classWithoutToString --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- undefined var --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- unset var --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- resource --
|
||||
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d
|
||||
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -95,18 +95,18 @@ result = Monday 2037-10-05 00:00:00 NZDT
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Adelaide
|
||||
ts = Friday 1971-01-01 17:17:17 CST
|
||||
result = Monday 1971-01-04 00:00:00 CST
|
||||
ts = Friday 1971-01-01 17:17:17 ACST
|
||||
result = Monday 1971-01-04 00:00:00 ACST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Darwin
|
||||
ts = Monday 1971-03-29 17:17:17 CST
|
||||
result = Monday 1971-04-05 00:00:00 CST
|
||||
ts = Monday 1971-03-29 17:17:17 ACST
|
||||
result = Monday 1971-04-05 00:00:00 ACST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
Australia/Perth
|
||||
ts = Friday 1971-01-01 17:17:17 WST
|
||||
result = Monday 1971-01-04 00:00:00 WST
|
||||
ts = Friday 1971-01-01 17:17:17 AWST
|
||||
result = Monday 1971-01-04 00:00:00 AWST
|
||||
wanted = Monday 00:00:00
|
||||
|
||||
America/Aruba
|
||||
|
||||
@@ -233,8 +233,8 @@ result=Saturday 1970-01-03 00:00:00 CAT 0
|
||||
wanted=Saturday 00:00:00
|
||||
|
||||
TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
|
||||
tStamp=Thursday 1980-04-24 17:17:17 KAST 0
|
||||
result=Thursday 1980-05-01 03:00:00 CST 0
|
||||
tStamp=Thursday 1980-04-24 17:17:17 XJT 0
|
||||
result=Thursday 1980-05-01 00:00:00 XJT 0
|
||||
wanted=Thursday 03:00:00
|
||||
|
||||
TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
|
||||
|
||||
@@ -39,5 +39,5 @@ datestr 10:00:00 AM July 1 2005 UTC
|
||||
|
||||
Setting TZ
|
||||
input 10:00:00 AM July 1 2005
|
||||
strftime 10:00:00 AM July 1 2005 EST +1000
|
||||
datestr 10:00:00 AM July 1 2005 EST
|
||||
strftime 10:00:00 AM July 1 2005 AEST +1000
|
||||
datestr 10:00:00 AM July 1 2005 AEST
|
||||
@@ -44,7 +44,7 @@ array(4) {
|
||||
|
||||
string(6) "Y-m-d+"
|
||||
string(19) "2001-11-29 13:20:01"
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -70,7 +70,7 @@ array(4) {
|
||||
|
||||
string(7) "Y-m-d +"
|
||||
string(19) "2001-11-29 13:20:01"
|
||||
object(DateTime)#3 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -96,7 +96,7 @@ array(4) {
|
||||
|
||||
string(6) "Y-m-d+"
|
||||
string(10) "2001-11-29"
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
@@ -139,7 +139,7 @@ array(4) {
|
||||
|
||||
string(7) "Y-m-d +"
|
||||
string(11) "2001-11-29 "
|
||||
object(DateTime)#2 (3) {
|
||||
object(DateTime)#%d (3) {
|
||||
["date"]=>
|
||||
string(26) "2001-11-29 %d:%d:%d.%d"
|
||||
["timezone_type"]=>
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
--TEST--
|
||||
Bug #66986 (Some timezones are no longer valid in PHP 5.5.10)
|
||||
--FILE--
|
||||
<?php
|
||||
$zones = array(
|
||||
"CST6CDT", "Cuba", "Egypt", "Eire", "EST5EDT", "Factory", "GB-Eire",
|
||||
"GMT0", "Greenwich", "Hongkong", "Iceland", "Iran", "Israel", "Jamaica",
|
||||
"Japan", "Kwajalein", "Libya", "MST7MDT", "Navajo", "NZ-CHAT", "Poland",
|
||||
"Portugal", "PST8PDT", "Singapore", "Turkey", "Universal", "W-SU",
|
||||
|
||||
"UTC", "GMT", "GMT+0100", "-0230",
|
||||
);
|
||||
|
||||
foreach ( $zones as $zone )
|
||||
{
|
||||
$d = new DateTimeZone( $zone );
|
||||
print_r($d);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => CST6CDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Cuba
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Egypt
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Eire
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => EST5EDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Factory
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => GB-Eire
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => GMT0
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Greenwich
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Hongkong
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Iceland
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Iran
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Israel
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Jamaica
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Japan
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Kwajalein
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Libya
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => MST7MDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Navajo
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => NZ-CHAT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Poland
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Portugal
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => PST8PDT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Singapore
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Turkey
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => Universal
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => W-SU
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 3
|
||||
[timezone] => UTC
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 2
|
||||
[timezone] => GMT
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 1
|
||||
[timezone] => +01:00
|
||||
)
|
||||
DateTimeZone Object
|
||||
(
|
||||
[timezone_type] => 1
|
||||
[timezone] => -02:30
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #67109 (First uppercase letter breaks date string parsing)
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(date('d.m.Y',strtotime('last day of april')));
|
||||
var_dump(date('d.m.Y',strtotime('Last day of april')));
|
||||
var_dump(date('d.m.Y',strtotime('lAst Day of April')));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "30.04.%d"
|
||||
string(10) "30.04.%d"
|
||||
string(10) "30.04.%d"
|
||||
@@ -73,12 +73,12 @@ bool(false)
|
||||
|
||||
-- Testing timezone_offset_get() function with an invalid values for $datetime argument --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -112,141 +112,141 @@ fclose( $file_handle );
|
||||
|
||||
-- int 0 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int 1 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int 12345 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int -12345 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float 10.5 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float -10.5 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- float .5 --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty array --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- int indexed array --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- associative array --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- nested arrays --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase NULL --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase null --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase true --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- lowercase false --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase TRUE --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- uppercase FALSE --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty string DQ --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- empty string SQ --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- string DQ --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- string SQ --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- mixed case string --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- heredoc --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- instance of classWithToString --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- instance of classWithoutToString --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- undefined var --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- unset var --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- resource --
|
||||
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d
|
||||
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
+1
-1
@@ -518,7 +518,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
|
||||
value = null_value;
|
||||
} else if (Z_TYPE_P(value) == IS_OBJECT) {
|
||||
/* these are zvalues create on demand, with refcount and is_ref
|
||||
* status left in an uninitalized stated */
|
||||
* status left in an uninitialized stated */
|
||||
zval_dtor(value);
|
||||
efree(value);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Test eregi() function : basic functionality - confirm case insensitivity
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test basic funtionality of eregi()
|
||||
* Test basic functionality of eregi()
|
||||
*/
|
||||
|
||||
echo "*** Testing eregi() : basic functionality ***\n";
|
||||
|
||||
+2
-2
@@ -2426,11 +2426,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
|
||||
data_ptr += 8;
|
||||
break;
|
||||
case TAG_FMT_SINGLE:
|
||||
memmove(data_ptr, &info_data->value.f, byte_count);
|
||||
memmove(data_ptr, &info_value->f, 4);
|
||||
data_ptr += 4;
|
||||
break;
|
||||
case TAG_FMT_DOUBLE:
|
||||
memmove(data_ptr, &info_data->value.d, byte_count);
|
||||
memmove(data_ptr, &info_value->d, 8);
|
||||
data_ptr += 8;
|
||||
break;
|
||||
}
|
||||
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 368 B |
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #68113 (Heap corruption in exif_thumbnail())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
|
||||
|
||||
Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
|
||||
bool(false)
|
||||
Done
|
||||
+2
-2
@@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then
|
||||
|
||||
dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL,
|
||||
dnl [
|
||||
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
|
||||
dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ])
|
||||
dnl ],[
|
||||
dnl AC_MSG_ERROR([wrong $extname lib version or lib not found])
|
||||
dnl ],[
|
||||
dnl -L\$${EXTNAME}_DIR/lib -lm
|
||||
dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm
|
||||
dnl ])
|
||||
dnl
|
||||
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
|
||||
|
||||
+156
-48
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/apprentice.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/apprentice.c Mon Sep 29 10:53:07 2014
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -479,6 +479,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
return NULL;
|
||||
}
|
||||
return map;
|
||||
@@ -1233,7 +1269,7 @@
|
||||
* the sign extension must have happened.
|
||||
*/
|
||||
case FILE_BYTE:
|
||||
- v = (char) v;
|
||||
+ v = (signed char) v;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
case FILE_BESHORT:
|
||||
@@ -1500,7 +1536,7 @@
|
||||
if (me->cont_count == me->max_count) {
|
||||
struct magic *nm;
|
||||
@@ -833,7 +842,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/ascmagic.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/ascmagic.c Mon Mar 10 16:40:55 2014
|
||||
@@ -139,7 +139,7 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -872,7 +881,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/cdf.c Tue Jul 1 09:00:09 2014
|
||||
+++ libmagic/cdf.c Wed Aug 20 21:20:34 2014
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -955,7 +964,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
errno = EFTYPE;
|
||||
return (size_t)-1;
|
||||
}
|
||||
@@ -796,7 +812,11 @@
|
||||
@@ -796,11 +812,15 @@
|
||||
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
|
||||
goto out;
|
||||
for (i = 0; i < sh.sh_properties; i++) {
|
||||
@@ -968,6 +977,11 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
q = (const uint8_t *)(const void *)
|
||||
((const char *)(const void *)p + ofs
|
||||
- 2 * sizeof(uint32_t));
|
||||
- if (q > e) {
|
||||
+ if (q < p || q > e) {
|
||||
DPRINTF(("Ran of the end %p > %p\n", q, e));
|
||||
goto out;
|
||||
}
|
||||
@@ -810,6 +830,10 @@
|
||||
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
|
||||
if (inp[i].pi_type & CDF_VECTOR) {
|
||||
@@ -1056,7 +1070,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
} else {
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/cdf.h Mon Apr 14 23:32:55 2014
|
||||
+++ libmagic/cdf.h Mon Dec 2 15:25:29 2013
|
||||
@@ -35,10 +35,12 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1099,7 +1113,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/cdf_time.c Mon Apr 14 23:32:55 2014
|
||||
+++ libmagic/cdf_time.c Mon Dec 2 15:25:29 2013
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -1159,7 +1173,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c Sun Jan 6 21:35:43 2013
|
||||
+++ libmagic/compress.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/compress.c Mon Dec 2 15:25:29 2013
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1322,7 +1336,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h Mon Feb 18 16:40:59 2013
|
||||
+++ libmagic/file.h Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/file.h Mon Mar 10 16:40:55 2014
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1532,7 +1546,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/fsmagic.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/fsmagic.c Mon Dec 2 15:25:29 2013
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1899,7 +1913,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/funcs.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/funcs.c Mon Mar 10 16:40:55 2014
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -2193,7 +2207,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013
|
||||
+++ libmagic/magic.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/magic.c Mon Dec 2 15:29:02 2013
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2537,7 +2551,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h Thu Mar 21 18:52:42 2013
|
||||
+++ libmagic/magic.h Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/magic.h Mon Dec 2 15:25:29 2013
|
||||
@@ -87,6 +87,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2556,14 +2570,14 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/print.c Mon Apr 14 23:42:51 2014
|
||||
@@ -29,12 +29,17 @@
|
||||
+++ libmagic/print.c Mon Dec 2 15:29:02 2013
|
||||
@@ -28,13 +28,17 @@
|
||||
/*
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
+#include "php.h"
|
||||
+
|
||||
|
||||
#include "file.h"
|
||||
+#include "cdf.h"
|
||||
|
||||
@@ -2575,7 +2589,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
@@ -43,188 +48,28 @@
|
||||
@@ -43,188 +47,28 @@
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
@@ -2776,7 +2790,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
}
|
||||
|
||||
protected const char *
|
||||
@@ -235,7 +80,7 @@
|
||||
@@ -235,7 +79,7 @@
|
||||
struct tm *tm;
|
||||
|
||||
if (flags & FILE_T_WINDOWS) {
|
||||
@@ -2787,7 +2801,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
}
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012
|
||||
+++ libmagic/readcdf.c Tue May 27 22:17:37 2014
|
||||
+++ libmagic/readcdf.c Thu Apr 24 19:54:40 2014
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2863,7 +2877,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
return -1;
|
||||
diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
--- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/readelf.c Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/readelf.c Sat Oct 25 11:50:05 2014
|
||||
@@ -48,8 +48,8 @@
|
||||
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
off_t, int *, int);
|
||||
@@ -2956,7 +2970,21 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
file_badread(ms);
|
||||
return -1;
|
||||
}
|
||||
@@ -852,24 +867,12 @@
|
||||
@@ -357,6 +372,13 @@
|
||||
uint32_t namesz, descsz;
|
||||
unsigned char *nbuf = CAST(unsigned char *, vbuf);
|
||||
|
||||
+ if (xnh_sizeof + offset > size) {
|
||||
+ /*
|
||||
+ * We're out of note headers.
|
||||
+ */
|
||||
+ return xnh_sizeof + offset;
|
||||
+ }
|
||||
+
|
||||
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
|
||||
offset += xnh_sizeof;
|
||||
|
||||
@@ -852,24 +874,12 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2984,7 +3012,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
file_badread(ms);
|
||||
return -1;
|
||||
}
|
||||
@@ -894,14 +897,17 @@
|
||||
@@ -894,14 +904,17 @@
|
||||
/* Things we can determine when we seek */
|
||||
switch (xsh_type) {
|
||||
case SHT_NOTE:
|
||||
@@ -3007,7 +3035,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -910,25 +916,16 @@
|
||||
@@ -910,25 +923,16 @@
|
||||
if (noff >= (off_t)xsh_size)
|
||||
break;
|
||||
noff = donote(ms, nbuf, (size_t)noff,
|
||||
@@ -3038,7 +3066,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
file_badseek(ms);
|
||||
return -1;
|
||||
}
|
||||
@@ -940,7 +937,7 @@
|
||||
@@ -940,7 +944,7 @@
|
||||
MAX(sizeof cap32, sizeof cap64)];
|
||||
if ((coff += xcap_sizeof) > (off_t)xsh_size)
|
||||
break;
|
||||
@@ -3047,7 +3075,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
(ssize_t)xcap_sizeof) {
|
||||
file_badread(ms);
|
||||
return -1;
|
||||
@@ -966,13 +963,12 @@
|
||||
@@ -966,13 +970,12 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3063,7 +3091,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1)
|
||||
return -1;
|
||||
if (cap_hw1) {
|
||||
@@ -1051,7 +1047,7 @@
|
||||
@@ -1051,7 +1054,7 @@
|
||||
const char *shared_libraries = "";
|
||||
unsigned char nbuf[BUFSIZ];
|
||||
ssize_t bufsize;
|
||||
@@ -3072,7 +3100,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
|
||||
if (size != xph_sizeof) {
|
||||
if (file_printf(ms, ", corrupted program header size") == -1)
|
||||
@@ -1060,8 +1056,13 @@
|
||||
@@ -1060,8 +1063,13 @@
|
||||
}
|
||||
|
||||
for ( ; num; num--) {
|
||||
@@ -3088,7 +3116,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1099,9 +1100,12 @@
|
||||
@@ -1099,9 +1107,12 @@
|
||||
* This is a PT_NOTE section; loop through all the notes
|
||||
* in the section.
|
||||
*/
|
||||
@@ -3104,7 +3132,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
if (bufsize == -1) {
|
||||
file_badread(ms);
|
||||
return -1;
|
||||
@@ -1162,7 +1166,7 @@
|
||||
@@ -1162,7 +1173,7 @@
|
||||
/*
|
||||
* If we cannot seek, it must be a pipe, socket or fifo.
|
||||
*/
|
||||
@@ -3115,7 +3143,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.orig/readelf.h libmagic/readelf.h
|
||||
--- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/readelf.h Mon Apr 14 23:42:51 2014
|
||||
+++ libmagic/readelf.h Mon Dec 2 15:25:29 2013
|
||||
@@ -44,9 +44,17 @@
|
||||
typedef uint32_t Elf32_Word;
|
||||
typedef uint8_t Elf32_Char;
|
||||
@@ -3136,7 +3164,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
|
||||
typedef uint8_t Elf64_Char;
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c Thu Mar 21 18:45:14 2013
|
||||
+++ libmagic/softmagic.c Tue Jul 1 09:00:09 2014
|
||||
+++ libmagic/softmagic.c Wed Aug 20 21:20:34 2014
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -3149,6 +3177,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
|
||||
private int match(struct magic_set *, struct magic *, uint32_t,
|
||||
const unsigned char *, size_t, size_t, int, int, int, int, int *, int *,
|
||||
@@ -53,7 +58,7 @@
|
||||
private int32_t moffset(struct magic_set *, struct magic *);
|
||||
private void mdebug(uint32_t, const char *, size_t);
|
||||
private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
|
||||
- const unsigned char *, uint32_t, size_t, size_t);
|
||||
+ const unsigned char *, uint32_t, size_t, struct magic *);
|
||||
private int mconvert(struct magic_set *, struct magic *, int);
|
||||
private int print_sep(struct magic_set *, int);
|
||||
private int handle_annotation(struct magic_set *, struct magic *);
|
||||
@@ -62,6 +67,8 @@
|
||||
private void cvt_32(union VALUETYPE *, const struct magic *);
|
||||
private void cvt_64(union VALUETYPE *, const struct magic *);
|
||||
@@ -3308,9 +3345,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
while (len--)
|
||||
*ptr1++ = *ptr2++;
|
||||
*ptr1 = '\0';
|
||||
@@ -1145,9 +1138,6 @@
|
||||
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
|
||||
nbytes, count);
|
||||
@@ -1010,7 +1003,7 @@
|
||||
|
||||
private int
|
||||
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt)
|
||||
+ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
|
||||
{
|
||||
/*
|
||||
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
|
||||
@@ -1030,15 +1023,24 @@
|
||||
const char *last; /* end of search region */
|
||||
const char *buf; /* start of search region */
|
||||
const char *end;
|
||||
- size_t lines;
|
||||
+ size_t lines, linecnt, bytecnt;
|
||||
+
|
||||
+ linecnt = m->str_range;
|
||||
+ bytecnt = linecnt * 80;
|
||||
|
||||
+ if (bytecnt == 0) {
|
||||
+ bytecnt = 8192;
|
||||
+ }
|
||||
+ if (bytecnt > nbytes) {
|
||||
+ bytecnt = nbytes;
|
||||
+ }
|
||||
if (s == NULL) {
|
||||
ms->search.s_len = 0;
|
||||
ms->search.s = NULL;
|
||||
return 0;
|
||||
}
|
||||
buf = RCAST(const char *, s) + offset;
|
||||
- end = last = RCAST(const char *, s) + nbytes;
|
||||
+ end = last = RCAST(const char *, s) + bytecnt;
|
||||
/* mget() guarantees buf <= last */
|
||||
for (lines = linecnt, b = buf; lines && b < end &&
|
||||
((b = CAST(const char *,
|
||||
@@ -1051,7 +1053,7 @@
|
||||
b++;
|
||||
}
|
||||
if (lines)
|
||||
- last = RCAST(const char *, s) + nbytes;
|
||||
+ last = RCAST(const char *, s) + bytecnt;
|
||||
|
||||
ms->search.s = buf;
|
||||
ms->search.s_len = last - buf;
|
||||
@@ -1125,7 +1127,6 @@
|
||||
int *need_separator, int *returnval)
|
||||
{
|
||||
uint32_t soffset, offset = ms->offset;
|
||||
- uint32_t count = m->str_range;
|
||||
int rv, oneed_separator;
|
||||
char *sbuf, *rbuf;
|
||||
union VALUETYPE *p = &ms->ms_value;
|
||||
@@ -1137,17 +1138,13 @@
|
||||
}
|
||||
|
||||
if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o),
|
||||
- (uint32_t)nbytes, count) == -1)
|
||||
+ (uint32_t)nbytes, m) == -1)
|
||||
return -1;
|
||||
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, "
|
||||
- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
|
||||
- nbytes, count);
|
||||
+ "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes);
|
||||
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
|
||||
-#ifndef COMPILE_ONLY
|
||||
- file_mdump(m);
|
||||
@@ -3318,7 +3418,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
|
||||
if (m->flag & INDIR) {
|
||||
@@ -1191,7 +1181,7 @@
|
||||
@@ -1191,7 +1188,7 @@
|
||||
}
|
||||
switch (cvt_flip(m->in_type, flip)) {
|
||||
case FILE_BYTE:
|
||||
@@ -3327,7 +3427,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1226,7 +1216,7 @@
|
||||
@@ -1226,7 +1223,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_BESHORT:
|
||||
@@ -3336,7 +3436,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1278,7 +1268,7 @@
|
||||
@@ -1278,7 +1275,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LESHORT:
|
||||
@@ -3345,7 +3445,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1330,7 +1320,7 @@
|
||||
@@ -1330,7 +1327,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
@@ -3354,7 +3454,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1367,7 +1357,7 @@
|
||||
@@ -1367,7 +1364,7 @@
|
||||
break;
|
||||
case FILE_BELONG:
|
||||
case FILE_BEID3:
|
||||
@@ -3363,7 +3463,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1438,7 +1428,7 @@
|
||||
@@ -1438,7 +1435,7 @@
|
||||
break;
|
||||
case FILE_LELONG:
|
||||
case FILE_LEID3:
|
||||
@@ -3372,7 +3472,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1508,7 +1498,7 @@
|
||||
@@ -1508,7 +1505,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_MELONG:
|
||||
@@ -3381,7 +3481,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1578,7 +1568,7 @@
|
||||
@@ -1578,7 +1575,7 @@
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LONG:
|
||||
@@ -3390,7 +3490,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1644,23 +1634,20 @@
|
||||
@@ -1637,30 +1634,27 @@
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
fprintf(stderr, "indirect +offs=%u\n", offset);
|
||||
}
|
||||
- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1)
|
||||
+ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
|
||||
return -1;
|
||||
ms->offset = offset;
|
||||
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
mdebug(offset, (char *)(void *)p,
|
||||
sizeof(union VALUETYPE));
|
||||
@@ -3416,7 +3524,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -1679,38 +1666,40 @@
|
||||
@@ -1679,38 +1673,40 @@
|
||||
case FILE_FLOAT:
|
||||
case FILE_BEFLOAT:
|
||||
case FILE_LEFLOAT:
|
||||
@@ -3463,7 +3571,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
|
||||
rbuf = ms->o.buf;
|
||||
@@ -1718,16 +1707,26 @@
|
||||
@@ -1718,16 +1714,26 @@
|
||||
ms->offset = soffset;
|
||||
if (rv == 1) {
|
||||
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
|
||||
@@ -3494,7 +3602,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return 0;
|
||||
sbuf = m->value.s;
|
||||
if (*sbuf == '^') {
|
||||
@@ -1837,6 +1836,42 @@
|
||||
@@ -1837,6 +1843,42 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -3537,7 +3645,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1996,69 +2031,157 @@
|
||||
@@ -1996,69 +2038,157 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -3608,7 +3716,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
+ zval *retval;
|
||||
+ zval *subpats;
|
||||
+ char *haystack;
|
||||
+
|
||||
+
|
||||
+ MAKE_STD_ZVAL(retval);
|
||||
+ ALLOC_INIT_ZVAL(subpats);
|
||||
+
|
||||
|
||||
@@ -1269,7 +1269,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
|
||||
* the sign extension must have happened.
|
||||
*/
|
||||
case FILE_BYTE:
|
||||
v = (char) v;
|
||||
v = (signed char) v;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
case FILE_BESHORT:
|
||||
|
||||
@@ -820,7 +820,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
q = (const uint8_t *)(const void *)
|
||||
((const char *)(const void *)p + ofs
|
||||
- 2 * sizeof(uint32_t));
|
||||
if (q > e) {
|
||||
if (q < p || q > e) {
|
||||
DPRINTF(("Ran of the end %p > %p\n", q, e));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -372,6 +372,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
|
||||
uint32_t namesz, descsz;
|
||||
unsigned char *nbuf = CAST(unsigned char *, vbuf);
|
||||
|
||||
if (xnh_sizeof + offset > size) {
|
||||
/*
|
||||
* We're out of note headers.
|
||||
*/
|
||||
return xnh_sizeof + offset;
|
||||
}
|
||||
|
||||
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
|
||||
offset += xnh_sizeof;
|
||||
|
||||
|
||||
+14
-2
@@ -5110,11 +5110,23 @@ PHP_FUNCTION(imagescale)
|
||||
return;
|
||||
}
|
||||
method = tmp_m;
|
||||
new_width = tmp_w;
|
||||
new_height = tmp_h;
|
||||
|
||||
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
|
||||
|
||||
if (tmp_h < 0) {
|
||||
/* preserve ratio */
|
||||
long src_x, src_y;
|
||||
|
||||
src_x = gdImageSX(im);
|
||||
src_y = gdImageSY(im);
|
||||
if (src_x) {
|
||||
tmp_h = tmp_w * src_y / src_x;
|
||||
}
|
||||
}
|
||||
|
||||
new_width = tmp_w;
|
||||
new_height = tmp_h;
|
||||
|
||||
if (gdImageSetInterpolationMethod(im, method)) {
|
||||
im_scaled = gdImageScale(im, new_width, new_height);
|
||||
}
|
||||
|
||||
@@ -124,6 +124,11 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
|
||||
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
|
||||
if (stream == NULL) {
|
||||
RETURN_FALSE;
|
||||
|
||||
+4
-2
@@ -370,9 +370,10 @@ static void *fontFetch (char **error, void *key)
|
||||
fontlist = gdEstrdup(a->fontlist);
|
||||
|
||||
/*
|
||||
* Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
|
||||
* Must use gd_strtok_r becasuse strtok() isn't thread safe
|
||||
*/
|
||||
for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) {
|
||||
char *strtok_ptr_path;
|
||||
/* make a fresh copy each time - strtok corrupts it. */
|
||||
path = gdEstrdup (fontsearchpath);
|
||||
|
||||
@@ -388,7 +389,8 @@ static void *fontFetch (char **error, void *key)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
|
||||
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
|
||||
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
|
||||
if (!strcmp(dir, ".")) {
|
||||
TSRMLS_FETCH();
|
||||
#if HAVE_GETCWD
|
||||
|
||||
@@ -20,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
(-1, 15)
|
||||
(156, 15)
|
||||
(156, -48)
|
||||
(15%d, 15)
|
||||
(15%d, -48)
|
||||
(-1, -48)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd2
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd2 TEST\n";
|
||||
imagegd2($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd2 TEST
|
||||
|
||||
Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd TEST\n";
|
||||
imagegd($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd TEST
|
||||
|
||||
Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegif
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['GIF Create Support']) || $support['GIF Create Support'] === false) {
|
||||
print 'skip gif support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegif TEST\n";
|
||||
imagegif($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegif TEST
|
||||
|
||||
Warning: imagegif(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagejpeg
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
|
||||
print 'skip jpeg support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagejpeg TEST\n";
|
||||
imagejpeg($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagejpeg TEST
|
||||
|
||||
Warning: imagejpeg(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagepng
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
|
||||
print 'skip png support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagepng TEST\n";
|
||||
imagepng($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagepng TEST
|
||||
|
||||
Warning: imagepng(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewbmp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
|
||||
print 'skip wbmp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewbmp TEST\n";
|
||||
imagewbmp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewbmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewebp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WEBP Support']) || $support['WEBP Support'] === false) {
|
||||
print 'skip webp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewebp TEST\n";
|
||||
imagewebp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewebp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
||||
# define MAX_BASE 36
|
||||
#endif
|
||||
|
||||
/* {{{ gmp_emalloc
|
||||
*/
|
||||
static void *gmp_emalloc(size_t size)
|
||||
{
|
||||
return emalloc(size);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ gmp_erealloc
|
||||
*/
|
||||
static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size)
|
||||
{
|
||||
return erealloc(ptr, new_size);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ gmp_efree
|
||||
*/
|
||||
static void gmp_efree(void *ptr, size_t size)
|
||||
{
|
||||
efree(ptr);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ ZEND_GINIT_FUNCTION
|
||||
*/
|
||||
static ZEND_GINIT_FUNCTION(gmp)
|
||||
@@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp)
|
||||
#endif
|
||||
REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Only check if utf8 string is valid, and compute utf16 lenght */
|
||||
/* Only check if utf8 string is valid, and compute utf16 length */
|
||||
for (j=0 ; pos < len ; j++) {
|
||||
us = php_next_utf8_char((const unsigned char *)utf8, len, &pos, &status);
|
||||
if (status != SUCCESS) {
|
||||
|
||||
+21
-2
@@ -385,6 +385,23 @@ static int _get_lderrno(LDAP *ldap)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ _set_lderrno
|
||||
*/
|
||||
static void _set_lderrno(LDAP *ldap, int lderr)
|
||||
{
|
||||
#if !HAVE_NSLDAP
|
||||
#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP
|
||||
/* New versions of OpenLDAP do it this way */
|
||||
ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr);
|
||||
#else
|
||||
ldap->ld_errno = lderr;
|
||||
#endif
|
||||
#else
|
||||
ldap_set_lderrno(ldap, lderr, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool ldap_bind(resource link [, string dn [, string password]])
|
||||
Bind to LDAP directory */
|
||||
PHP_FUNCTION(ldap_bind)
|
||||
@@ -399,18 +416,20 @@ PHP_FUNCTION(ldap_bind)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -260,7 +260,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
|
||||
goto out;
|
||||
}
|
||||
|
||||
num = n; /* make sure to process initilized vars only */
|
||||
num = n; /* make sure to process initialized vars only */
|
||||
|
||||
/* initialize converter */
|
||||
if (info->num_from_encodings <= 0) {
|
||||
|
||||
@@ -62,18 +62,18 @@ mysqli_close($link);
|
||||
--EXPECT--
|
||||
array(7) {
|
||||
[0]=>
|
||||
float(3.14159274101)
|
||||
float(3.141593)
|
||||
[1]=>
|
||||
float(-9.99999997475E-7)
|
||||
float(-1.0E-6)
|
||||
[2]=>
|
||||
float(0)
|
||||
[3]=>
|
||||
float(999999995904)
|
||||
float(1.0E+12)
|
||||
[4]=>
|
||||
float(0.564642488956)
|
||||
float(0.5646425)
|
||||
[5]=>
|
||||
float(1)
|
||||
[6]=>
|
||||
float(8.88888914608E+14)
|
||||
float(8.888889E+14)
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -67,7 +67,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(4999999)
|
||||
[4]=>
|
||||
float(2345.60009766)
|
||||
float(2345.6)
|
||||
[5]=>
|
||||
float(5678.89563)
|
||||
[6]=>
|
||||
@@ -75,4 +75,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(11) "mysql rulez"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -66,7 +66,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(54)
|
||||
[4]=>
|
||||
float(2.59999990463)
|
||||
float(2.6)
|
||||
[5]=>
|
||||
float(58.89)
|
||||
[6]=>
|
||||
@@ -74,4 +74,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(3) "6.7"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
mysqli_float_handling - ensure 4 byte float is handled correctly
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, "CREATE TABLE test(id INT PRIMARY KEY, fp4 FLOAT, fp8 DOUBLE) ENGINE = InnoDB")) {
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
// Insert via string to make sure the real floating number gets to the DB
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, fp4, fp8) VALUES (1, 9.9999, 9.9999)")) {
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!($stmt = mysqli_prepare($link, "SELECT id, fp4, fp8 FROM test"))) {
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_stmt_execute($stmt)) {
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!($result = mysqli_stmt_get_result($stmt))) {
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
$data = mysqli_fetch_assoc($result);
|
||||
print $data['id'] . ": " . $data['fp4'] . ": " . $data['fp8'] . "\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
1: 9.9999: 9.9999
|
||||
@@ -41,6 +41,11 @@ require_once('skipifconnectfailure.inc');
|
||||
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
|
||||
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
|
||||
printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
@@ -109,4 +114,4 @@ require_once('skipifconnectfailure.inc');
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -48,6 +48,14 @@ if (mysqli_get_server_version($link) >= 50600)
|
||||
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
|
||||
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because Percona and MariaDB block any commands after 3 failed
|
||||
// change_user commands
|
||||
mysqli_close($link);
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[020] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
}
|
||||
if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
|
||||
printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
@@ -116,4 +124,4 @@ if (mysqli_get_server_version($link) >= 50600)
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -43,6 +43,11 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
if (false !== ($tmp = $mysqli->change_user($user, $passwd, $db . '_unknown_really')))
|
||||
printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!$mysqli->query('SET @mysqli_change_user_test_var=1'))
|
||||
printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error);
|
||||
|
||||
@@ -81,4 +86,4 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -36,7 +36,7 @@ $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
|
||||
mysqli_error($link));
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(3), PRIMARY
|
||||
KEY(id)) ENGINE=' . $engine . " DEFAULT CHARSET=gbk")) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link),
|
||||
mysqli_error($link));
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
--TEST--
|
||||
Multiple result set with PS
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once("connect.inc");
|
||||
if (!$IS_MYSQLND) {
|
||||
die("skip mysqlnd only test");
|
||||
}
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require('table.inc');
|
||||
|
||||
$stmt = mysqli_stmt_init($link);
|
||||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) {
|
||||
printf("[001] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
|
||||
if (!$link->query("CREATE PROCEDURE p123() BEGIN SELECT id+12, CONCAT_WS('-',label,'ahoi') FROM test ORDER BY id LIMIT 1; SELECT id + 42, CONCAT_WS('---',label, label) FROM test ORDER BY id LIMIT 1; END")) {
|
||||
printf("[002] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
|
||||
if (!($stmt = $link->prepare("CALL p123"))) {
|
||||
printf("[003] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
printf("[005] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
$c_id = NULL;
|
||||
$c_label = NULL;
|
||||
if (!$stmt->bind_result($c_id, $c_label)) {
|
||||
printf("[004] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
var_dump("pre:",$c_id, $c_label);
|
||||
|
||||
if (!$stmt->fetch()) {
|
||||
printf("[006] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
var_dump("post:",$c_id, $c_label);
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[007] Shouldn't have fetched anything\n");
|
||||
var_dump($c_id, $c_label);
|
||||
}
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[008] No more rows expected\n");
|
||||
}
|
||||
|
||||
if (!$stmt->more_results()) {
|
||||
printf("[009] Expected more results\n");
|
||||
} else {
|
||||
var_dump("[009] next_result:", $stmt->next_result());
|
||||
}
|
||||
|
||||
if (!$stmt->bind_result($c_id, $c_label)) {
|
||||
printf("[010] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
var_dump("pre:",$c_id, $c_label);
|
||||
|
||||
if (!$stmt->fetch()) {
|
||||
printf("[011] [%d] %s\n", $stmt->error, $stmt->errno);
|
||||
}
|
||||
|
||||
var_dump("post:",$c_id, $c_label);
|
||||
|
||||
if ($stmt->fetch()) {
|
||||
printf("[012] No more rows expected\n");
|
||||
}
|
||||
|
||||
if (!$stmt->more_results()) {
|
||||
printf("[013] Expected more results\n");
|
||||
} else {
|
||||
var_dump("[013] next_result:", $stmt->next_result());
|
||||
}
|
||||
|
||||
if ($stmt->more_results()) {
|
||||
printf("[014] No more results expected\n");
|
||||
} else {
|
||||
printf("[014] No result, as expected\n");
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$link->close();
|
||||
|
||||
|
||||
echo "done";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
if (!$link->query('DROP PROCEDURE IF EXISTS p123')) {
|
||||
printf("[001] [%d] %s\n", $link->error, $link->errno);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(4) "pre:"
|
||||
NULL
|
||||
NULL
|
||||
string(5) "post:"
|
||||
int(13)
|
||||
string(6) "a-ahoi"
|
||||
string(18) "[009] next_result:"
|
||||
bool(true)
|
||||
string(4) "pre:"
|
||||
int(13)
|
||||
string(6) "a-ahoi"
|
||||
string(5) "post:"
|
||||
int(43)
|
||||
string(5) "a---a"
|
||||
string(18) "[013] next_result:"
|
||||
bool(true)
|
||||
[014] No result, as expected
|
||||
done
|
||||
@@ -12,6 +12,11 @@ if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'SET SESSION sql_mode=\'\'')) {
|
||||
printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT DEFAULT 0, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
@@ -20,4 +25,4 @@ if (!mysqli_query($link, 'CREATE TABLE test(id INT DEFAULT 0, label CHAR(1), PRI
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')")) {
|
||||
printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -61,3 +61,34 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes" || test "$
|
||||
#endif
|
||||
])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if the compiler supports Decimal32/64/128 types from the IEEE-754 2008 version
|
||||
dnl References: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1657.pdf
|
||||
dnl http://speleotrove.com/decimal/
|
||||
dnl
|
||||
AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[
|
||||
AC_TRY_RUN( [
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 k = 99.49f;
|
||||
double d2 = (double)k;
|
||||
const char *check_str = "99.49";
|
||||
char print_str[32];
|
||||
|
||||
snprintf(print_str, 32, "%f", d2);
|
||||
return memcmp(print_str, check_str, 5);
|
||||
}
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=yes
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
])])
|
||||
if test "$ac_cv_decimal_fp_supported" = "yes"; then
|
||||
AC_DEFINE(HAVE_DECIMAL_FP_SUPPORT, 1, [Define if the compiler supports Decimal32/64/128 types.])
|
||||
fi
|
||||
@@ -929,7 +929,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
|
||||
DBG_RETURN(PASS);
|
||||
#else
|
||||
DBG_ENTER("mysqlnd_net::enable_ssl");
|
||||
DBG_INFO("MYSQLND_SSL_SUPPORTED is not defined");
|
||||
DBG_INF("MYSQLND_SSL_SUPPORTED is not defined");
|
||||
DBG_RETURN(PASS);
|
||||
#endif
|
||||
}
|
||||
|
||||
+34
-17
@@ -50,6 +50,7 @@ enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES *result, void *param,
|
||||
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
|
||||
static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
|
||||
|
||||
static void MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC);
|
||||
|
||||
/* {{{ mysqlnd_stmt::store_result */
|
||||
static MYSQLND_RES *
|
||||
@@ -226,7 +227,7 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
|
||||
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
|
||||
|
||||
/* Free space for next result */
|
||||
s->m->free_stmt_content(s TSRMLS_CC);
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(s TSRMLS_CC);
|
||||
{
|
||||
enum_func_status ret = s->m->parse_execute_response(s TSRMLS_CC);
|
||||
DBG_RETURN(ret);
|
||||
@@ -2061,6 +2062,37 @@ mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_stmt::free_stmt_result */
|
||||
static void
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
{
|
||||
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
|
||||
DBG_ENTER("mysqlnd_stmt::free_stmt_result");
|
||||
if (!stmt) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
First separate the bound variables, which point to the result set, then
|
||||
destroy the set.
|
||||
*/
|
||||
mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
|
||||
/* Not every statement has a result set attached */
|
||||
if (stmt->result) {
|
||||
stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
|
||||
stmt->result = NULL;
|
||||
}
|
||||
if (stmt->error_info->error_list) {
|
||||
zend_llist_clean(stmt->error_info->error_list);
|
||||
mnd_pefree(stmt->error_info->error_list, s->persistent);
|
||||
stmt->error_info->error_list = NULL;
|
||||
}
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_stmt::free_stmt_content */
|
||||
static void
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
@@ -2093,22 +2125,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
|
||||
stmt->param_bind = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
First separate the bound variables, which point to the result set, then
|
||||
destroy the set.
|
||||
*/
|
||||
mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
|
||||
/* Not every statement has a result set attached */
|
||||
if (stmt->result) {
|
||||
stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
|
||||
stmt->result = NULL;
|
||||
}
|
||||
if (stmt->error_info->error_list) {
|
||||
zend_llist_clean(stmt->error_info->error_list);
|
||||
mnd_pefree(stmt->error_info->error_list, s->persistent);
|
||||
stmt->error_info->error_list = NULL;
|
||||
}
|
||||
|
||||
MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(s TSRMLS_CC);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -174,12 +174,63 @@ ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
|
||||
static void
|
||||
ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
|
||||
{
|
||||
float value;
|
||||
float fval;
|
||||
double dval;
|
||||
DBG_ENTER("ps_fetch_float");
|
||||
float4get(value, *row);
|
||||
ZVAL_DOUBLE(zv, value);
|
||||
float4get(fval, *row);
|
||||
(*row)+= 4;
|
||||
DBG_INF_FMT("value=%f", value);
|
||||
DBG_INF_FMT("value=%f", fval);
|
||||
|
||||
/*
|
||||
* The following is needed to correctly support 4-byte floats.
|
||||
* Otherwise, a value of 9.99 in a FLOAT column comes out of mysqli
|
||||
* as 9.9998998641968.
|
||||
*
|
||||
* For GCC, we use the built-in decimal support to "up-convert" a
|
||||
* 4-byte float to a 8-byte double.
|
||||
* When that is not available, we fall back to converting the float
|
||||
* to a string and then converting the string to a double. This mimics
|
||||
* what MySQL does.
|
||||
*/
|
||||
#ifdef HAVE_DECIMAL_FP_SUPPORT
|
||||
{
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 d32val = fval;
|
||||
|
||||
/* The following cast is guaranteed to do the right thing */
|
||||
dval = (double) d32val;
|
||||
}
|
||||
#elif defined(PHP_WIN32)
|
||||
{
|
||||
/* float datatype on Winows is already 4 byte but has a precision of 7 digits */
|
||||
char num_buf[2048];
|
||||
(void)_gcvt_s(num_buf, 2048, fval, field->decimals >= 31 ? 7 : field->decimals);
|
||||
dval = zend_strtod(num_buf, NULL);
|
||||
}
|
||||
#else
|
||||
{
|
||||
char num_buf[2048]; /* Over allocated */
|
||||
char *s;
|
||||
|
||||
#ifndef FLT_DIG
|
||||
# define FLT_DIG 6
|
||||
#endif
|
||||
/* Convert to string. Ignoring localization, etc.
|
||||
* Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31)
|
||||
* or larger than 31, the value is limited to 6 (FLT_DIG).
|
||||
*/
|
||||
s = php_gcvt(fval,
|
||||
field->decimals >= 31 ? FLT_DIG : field->decimals,
|
||||
'.',
|
||||
'e',
|
||||
num_buf);
|
||||
|
||||
/* And now convert back to double */
|
||||
dval = zend_strtod(s, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
ZVAL_DOUBLE(zv, dval);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1151,7 +1151,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
|
||||
No need to FREE_ALLOCA as we can reuse the
|
||||
'lengths' and 'fields' arrays. For lengths its absolutely safe.
|
||||
'fields' is reused because the ownership of the strings has been
|
||||
transfered above.
|
||||
transferred above.
|
||||
*/
|
||||
}
|
||||
/* Overflow ? */
|
||||
|
||||
+3
-2
@@ -951,14 +951,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
|
||||
SQLUSMALLINT colfieldid;
|
||||
int charextraalloc;
|
||||
|
||||
colfieldid = SQL_COLUMN_DISPLAY_SIZE;
|
||||
charextraalloc = 0;
|
||||
result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0);
|
||||
|
||||
result->longreadlen = ODBCG(defaultlrl);
|
||||
result->binmode = ODBCG(defaultbinmode);
|
||||
|
||||
for(i = 0; i < result->numcols; i++) {
|
||||
charextraalloc = 0;
|
||||
colfieldid = SQL_COLUMN_DISPLAY_SIZE;
|
||||
|
||||
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME,
|
||||
result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
|
||||
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE,
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
--TEST--
|
||||
odbc_exec(): Getting accurate date data from query
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include 'config.inc';
|
||||
|
||||
$id_1_date = '2014-09-23';
|
||||
$id_2_date = '2014-09-24';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
@odbc_exec($conn, 'CREATE DATABASE odbcTEST');
|
||||
|
||||
odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL VARCHAR(100), DATE_COL DATE)');
|
||||
|
||||
odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (1, 'hello', '$id_1_date')");
|
||||
odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (2, 'helloagain', '$id_2_date')");
|
||||
|
||||
$res = odbc_exec($conn, 'SELECT * FROM FOO ORDER BY ID ASC');
|
||||
|
||||
while(odbc_fetch_row($res)) {
|
||||
$id = odbc_result($res, "ID");
|
||||
$varchar_col = odbc_result($res, "VARCHAR_COL");
|
||||
$date = odbc_result($res, "DATE_COL");
|
||||
|
||||
if ($id == 1) {
|
||||
if ($date != $id_1_date) {
|
||||
print "Date_1 mismatched\n";
|
||||
} else {
|
||||
print "Date_1 matched\n";
|
||||
}
|
||||
} else {
|
||||
if ($date != $id_2_date) {
|
||||
print "Date_2 mismatched\n";
|
||||
} else {
|
||||
print "Date_2 matched\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Date_1 matched
|
||||
Date_2 matched
|
||||
--CLEAN--
|
||||
<?php
|
||||
include 'config.inc';
|
||||
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
|
||||
odbc_exec($conn, 'DROP TABLE FOO');
|
||||
odbc_exec($conn, 'DROP DATABASE odbcTEST');
|
||||
|
||||
?>
|
||||
@@ -339,9 +339,14 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
|
||||
break;
|
||||
#endif
|
||||
case STREAM_CRYPTO_METHOD_SSLv3_CLIENT:
|
||||
#ifdef OPENSSL_NO_SSL3
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
|
||||
return -1;
|
||||
#else
|
||||
sslsock->is_client = 1;
|
||||
method = SSLv3_client_method();
|
||||
break;
|
||||
#endif
|
||||
case STREAM_CRYPTO_METHOD_TLS_CLIENT:
|
||||
sslsock->is_client = 1;
|
||||
method = TLSv1_client_method();
|
||||
@@ -351,9 +356,14 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
|
||||
method = SSLv23_server_method();
|
||||
break;
|
||||
case STREAM_CRYPTO_METHOD_SSLv3_SERVER:
|
||||
#ifdef OPENSSL_NO_SSL3
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
|
||||
return -1;
|
||||
#else
|
||||
sslsock->is_client = 0;
|
||||
method = SSLv3_server_method();
|
||||
break;
|
||||
#endif
|
||||
case STREAM_CRYPTO_METHOD_SSLv2_SERVER:
|
||||
#ifdef OPENSSL_NO_SSL2
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
|
||||
@@ -825,6 +835,21 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
|
||||
|
||||
case PHP_STREAM_AS_FD_FOR_SELECT:
|
||||
if (ret) {
|
||||
/* OpenSSL has an internal buffer which select() cannot see. If we don't
|
||||
* fetch it into the stream's buffer, no activity will be reported on the
|
||||
* stream even though there is data waiting to be read - but we only fetch
|
||||
* the lower of bytes OpenSSL has ready to give us or chunk_size since we
|
||||
* weren't asked for any data at this stage. This is only likely to cause
|
||||
* issues with non-blocking streams, but it's harmless to always do it. */
|
||||
size_t pending;
|
||||
if (stream->writepos == stream->readpos
|
||||
&& sslsock->ssl_active
|
||||
&& (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) {
|
||||
php_stream_fill_read_buffer(stream, pending < stream->chunk_size
|
||||
? pending
|
||||
: stream->chunk_size);
|
||||
}
|
||||
|
||||
*(php_socket_t *)ret = sslsock->s.socket;
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
@@ -5311,7 +5311,7 @@ by an auxiliary program - but can then be edited by hand if required. There are
|
||||
now no calls to isalnum(), isspace(), isdigit(), isxdigit(), tolower() or
|
||||
toupper() in the code.
|
||||
|
||||
7. Turn the malloc/free funtions variables into pcre_malloc and pcre_free and
|
||||
7. Turn the malloc/free functions variables into pcre_malloc and pcre_free and
|
||||
make them global. Abolish the function for setting them, as the caller can now
|
||||
set them directly.
|
||||
|
||||
|
||||
@@ -3380,6 +3380,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
|
||||
|
||||
zend_try {
|
||||
failed = 0;
|
||||
CG(zend_lineno) = 0;
|
||||
res = phar_orig_compile_file(file_handle, type TSRMLS_CC);
|
||||
} zend_catch {
|
||||
failed = 1;
|
||||
|
||||
@@ -3,6 +3,7 @@ Phar front controller $_SERVER munging success [cache_list]
|
||||
--INI--
|
||||
default_charset=UTF-8
|
||||
phar.cache_list={PWD}/frontcontroller21.php
|
||||
cgi.fix_pathinfo=1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
--ENV--
|
||||
@@ -22,4 +23,4 @@ string(18) "/index.php?test=hi"
|
||||
string(32) "/frontcontroller21.php/index.php"
|
||||
string(22) "/frontcontroller21.php"
|
||||
string(%d) "%sfrontcontroller21.php"
|
||||
string(40) "/frontcontroller21.php/index.php?test=hi"
|
||||
string(40) "/frontcontroller21.php/index.php?test=hi"
|
||||
@@ -2,6 +2,7 @@
|
||||
Phar front controller $_SERVER munging success
|
||||
--INI--
|
||||
default_charset=UTF-8
|
||||
cgi.fix_pathinfo=1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
--ENV--
|
||||
@@ -21,4 +22,4 @@ string(18) "/index.php?test=hi"
|
||||
string(32) "/frontcontroller21.php/index.php"
|
||||
string(22) "/frontcontroller21.php"
|
||||
string(%d) "%sfrontcontroller21.php"
|
||||
string(40) "/frontcontroller21.php/index.php?test=hi"
|
||||
string(40) "/frontcontroller21.php/index.php?test=hi"
|
||||
@@ -2,6 +2,7 @@
|
||||
Phar front controller $_SERVER munging success tar-based
|
||||
--INI--
|
||||
default_charset=UTF-8
|
||||
cgi.fix_pathinfo=1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
--ENV--
|
||||
@@ -21,4 +22,4 @@ string(18) "/index.php?test=hi"
|
||||
string(37) "/frontcontroller21.phar.php/index.php"
|
||||
string(27) "/frontcontroller21.phar.php"
|
||||
string(%d) "%sfrontcontroller21.phar.php"
|
||||
string(45) "/frontcontroller21.phar.php/index.php?test=hi"
|
||||
string(45) "/frontcontroller21.phar.php/index.php?test=hi"
|
||||
@@ -2,6 +2,7 @@
|
||||
Phar front controller $_SERVER munging success zip-based
|
||||
--INI--
|
||||
default_charset=UTF-8
|
||||
cgi.fix_pathinfo=1
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
<?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
|
||||
@@ -22,4 +23,4 @@ string(18) "/index.php?test=hi"
|
||||
string(37) "/frontcontroller21.phar.php/index.php"
|
||||
string(27) "/frontcontroller21.phar.php"
|
||||
string(%d) "%sfrontcontroller21.phar.php"
|
||||
string(45) "/frontcontroller21.phar.php/index.php?test=hi"
|
||||
string(45) "/frontcontroller21.phar.php/index.php?test=hi"
|
||||
@@ -1007,9 +1007,12 @@ static int _extension_class_string(zend_class_entry **pce TSRMLS_DC, int num_arg
|
||||
int *num_classes = va_arg(args, int*);
|
||||
|
||||
if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) {
|
||||
string_printf(str, "\n");
|
||||
_class_string(str, *pce, NULL, indent TSRMLS_CC);
|
||||
(*num_classes)++;
|
||||
/* dump class if it is not an alias */
|
||||
if (!zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) {
|
||||
string_printf(str, "\n");
|
||||
_class_string(str, *pce, NULL, indent TSRMLS_CC);
|
||||
(*num_classes)++;
|
||||
}
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
@@ -5360,12 +5363,24 @@ static int add_extension_class(zend_class_entry **pce TSRMLS_DC, int num_args, v
|
||||
int add_reflection_class = va_arg(args, int);
|
||||
|
||||
if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) {
|
||||
const char *name;
|
||||
int nlen;
|
||||
|
||||
if (zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) {
|
||||
/* This is an class alias, use alias name */
|
||||
name = hash_key->arKey;
|
||||
nlen = hash_key->nKeyLength-1;
|
||||
} else {
|
||||
/* Use class name */
|
||||
name = (*pce)->name;
|
||||
nlen = (*pce)->name_length;
|
||||
}
|
||||
if (add_reflection_class) {
|
||||
ALLOC_ZVAL(zclass);
|
||||
zend_reflection_class_factory(*pce, zclass TSRMLS_CC);
|
||||
add_assoc_zval_ex(class_array, (*pce)->name, (*pce)->name_length + 1, zclass);
|
||||
add_assoc_zval_ex(class_array, name, nlen+1, zclass);
|
||||
} else {
|
||||
add_next_index_stringl(class_array, (*pce)->name, (*pce)->name_length, 1);
|
||||
add_next_index_stringl(class_array, name, nlen, 1);
|
||||
}
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
@@ -6046,7 +6061,7 @@ ZEND_END_ARG_INFO()
|
||||
static const zend_function_entry reflection_zend_extension_functions[] = {
|
||||
ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
|
||||
ZEND_ME(reflection_zend_extension, export, arginfo_reflection_extension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
|
||||
ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_extension___construct, 0)
|
||||
ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_zend_extension___construct, 0)
|
||||
ZEND_ME(reflection_zend_extension, __toString, arginfo_reflection__void, 0)
|
||||
ZEND_ME(reflection_zend_extension, getName, arginfo_reflection__void, 0)
|
||||
ZEND_ME(reflection_zend_extension, getVersion, arginfo_reflection__void, 0)
|
||||
|
||||
@@ -148,6 +148,8 @@ PHP_METHOD(SessionHandler, create_sid)
|
||||
{
|
||||
char *id;
|
||||
|
||||
PS_SANITY_CHECK;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #67972: SessionHandler Invalid memory read create_sid()
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
(new SessionHandler)->create_sid();
|
||||
--EXPECTF--
|
||||
Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d
|
||||
@@ -1,9 +1,7 @@
|
||||
--TEST--
|
||||
Bug #62328 (implementing __toString and a cast to string fails)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once("skipif.inc");
|
||||
?>
|
||||
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class UberSimpleXML extends SimpleXMLElement {
|
||||
@@ -373,7 +373,7 @@ class Interop_Client
|
||||
}
|
||||
$soap =& $endpoint_info['client'];
|
||||
|
||||
# XXX how do we determine a failure on retreiving/parsing wsdl?
|
||||
# XXX how do we determine a failure on retrieving/parsing wsdl?
|
||||
if ($soap->wsdl->fault) {
|
||||
$fault = $soap->wsdl->fault;
|
||||
$soap_test->setResult(0,'WSDL',
|
||||
|
||||
+1
-1
@@ -326,7 +326,7 @@ PHP_FUNCTION(spl_autoload)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (file_exts == NULL) { /* autoload_extensions is not intialzed, set to defaults */
|
||||
if (file_exts == NULL) { /* autoload_extensions is not initialized, set to defaults */
|
||||
copy = pos1 = estrndup(SPL_DEFAULT_FILE_EXTENSIONS, sizeof(SPL_DEFAULT_FILE_EXTENSIONS)-1);
|
||||
} else {
|
||||
copy = pos1 = estrndup(file_exts, file_exts_len);
|
||||
|
||||
@@ -49,6 +49,41 @@ static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval,
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ spl_instantiate_arg_n */
|
||||
static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval **retval, int argc, zval ***argv TSRMLS_DC)
|
||||
{
|
||||
zend_function *func = pce->constructor;
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fcc;
|
||||
zval *dummy;
|
||||
zval z_name;
|
||||
|
||||
spl_instantiate(pce, retval, 0 TSRMLS_CC);
|
||||
|
||||
ZVAL_STRING(&z_name, func->common.function_name, 0);
|
||||
|
||||
fci.size = sizeof(zend_fcall_info);
|
||||
fci.function_table = &pce->function_table;
|
||||
fci.function_name = &z_name;
|
||||
fci.object_ptr = *retval;
|
||||
fci.symbol_table = NULL;
|
||||
fci.retval_ptr_ptr = &dummy;
|
||||
fci.param_count = argc;
|
||||
fci.params = argv;
|
||||
fci.no_separation = 1;
|
||||
|
||||
fcc.initialized = 1;
|
||||
fcc.function_handler = func;
|
||||
fcc.calling_scope = EG(scope);
|
||||
fcc.called_scope = pce;
|
||||
fcc.object_ptr = *retval;
|
||||
|
||||
zend_call_function(&fci, &fcc TSRMLS_CC);
|
||||
|
||||
zval_ptr_dtor(&dummy);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif /* SPL_ENGINE_H */
|
||||
|
||||
/*
|
||||
|
||||
+53
-6
@@ -1414,7 +1414,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
|
||||
return NULL;
|
||||
}
|
||||
if (spl_cit_check_flags(flags) != SUCCESS) {
|
||||
zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_CURRENT", 0 TSRMLS_CC);
|
||||
zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1979,8 +1979,10 @@ SPL_METHOD(RegexIterator, accept)
|
||||
|
||||
if (intern->current.data == NULL) {
|
||||
RETURN_FALSE;
|
||||
} else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (intern->u.regex.flags & REGIT_USE_KEY) {
|
||||
subject_ptr = intern->current.key;
|
||||
} else {
|
||||
@@ -2014,8 +2016,7 @@ SPL_METHOD(RegexIterator, accept)
|
||||
ALLOC_INIT_ZVAL(intern->current.data);
|
||||
php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount,
|
||||
intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
|
||||
count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
|
||||
RETVAL_BOOL(count > 0);
|
||||
RETVAL_BOOL(Z_LVAL(zcount) > 0);
|
||||
break;
|
||||
|
||||
case REGIT_MODE_SPLIT:
|
||||
@@ -2193,7 +2194,7 @@ SPL_METHOD(RecursiveRegexIterator, __construct)
|
||||
SPL_METHOD(RecursiveRegexIterator, getChildren)
|
||||
{
|
||||
spl_dual_it_object *intern;
|
||||
zval *retval, *regex;
|
||||
zval *retval;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
@@ -2203,16 +2204,61 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
|
||||
|
||||
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
|
||||
if (!EG(exception)) {
|
||||
zval **args[5], *object, *regex, *mode, *flags, *preg_flags;
|
||||
|
||||
MAKE_STD_ZVAL(object);
|
||||
MAKE_STD_ZVAL(regex);
|
||||
MAKE_STD_ZVAL(mode);
|
||||
MAKE_STD_ZVAL(flags);
|
||||
MAKE_STD_ZVAL(preg_flags);
|
||||
|
||||
MAKE_COPY_ZVAL(&retval, object);
|
||||
ZVAL_STRING(regex, intern->u.regex.regex, 1);
|
||||
spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, retval, regex TSRMLS_CC);
|
||||
ZVAL_LONG(mode, intern->u.regex.mode);
|
||||
ZVAL_LONG(flags, intern->u.regex.flags);
|
||||
ZVAL_LONG(preg_flags, intern->u.regex.preg_flags);
|
||||
|
||||
args[0] = &object;
|
||||
args[1] = ®ex;
|
||||
args[2] = &mode;
|
||||
args[3] = &flags;
|
||||
args[4] = &preg_flags;
|
||||
|
||||
spl_instantiate_arg_n(Z_OBJCE_P(getThis()), &return_value, 5, args TSRMLS_CC);
|
||||
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(®ex);
|
||||
zval_ptr_dtor(&mode);
|
||||
zval_ptr_dtor(&flags);
|
||||
zval_ptr_dtor(&preg_flags);
|
||||
}
|
||||
if (retval) {
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
SPL_METHOD(RecursiveRegexIterator, accept)
|
||||
{
|
||||
spl_dual_it_object *intern;
|
||||
zval *rv;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
|
||||
|
||||
if (intern->current.data == NULL) {
|
||||
RETURN_FALSE;
|
||||
} else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) {
|
||||
RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(intern->current.data)) > 0);
|
||||
}
|
||||
|
||||
zend_call_method_with_0_params(&(getThis()), spl_ce_RegexIterator, NULL, "accept", &rv);
|
||||
|
||||
RETURN_ZVAL(rv, 1, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* {{{ spl_dual_it_dtor */
|
||||
@@ -2403,6 +2449,7 @@ ZEND_END_ARG_INFO();
|
||||
|
||||
static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
|
||||
SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC)
|
||||
SPL_ME(RecursiveRegexIterator, accept, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
|
||||
SPL_ME(RecursiveFilterIterator, hasChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
|
||||
SPL_ME(RecursiveRegexIterator, getChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
--TEST--
|
||||
Bug #68128 - RecursiveRegexIterator raises "Array to string conversion" notice
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = new ArrayIterator(array('a', array('b', 'c')));
|
||||
$regex = new RegexIterator($array, '/Array/');
|
||||
|
||||
foreach ($regex as $match) {
|
||||
var_dump($match);
|
||||
}
|
||||
|
||||
$rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5')));
|
||||
$rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^(t)est(\d*)/',
|
||||
RecursiveRegexIterator::ALL_MATCHES, 0, PREG_PATTERN_ORDER);
|
||||
|
||||
foreach ($rRegexIterator as $key1 => $value1) {
|
||||
|
||||
if ($rRegexIterator->hasChildren()) {
|
||||
|
||||
// print all children
|
||||
echo "Children: ";
|
||||
foreach ($rRegexIterator->getChildren() as $key => $value) {
|
||||
print_r($value);
|
||||
}
|
||||
echo "\n";
|
||||
} else {
|
||||
echo "No children ";
|
||||
print_r($value1);
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
No children Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => test1
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => t
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
Children: Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => test4
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => t
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => 4
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => test5
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => t
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => 5
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
@@ -13,11 +13,6 @@ class MyRecursiveRegexIterator extends RecursiveRegexIterator
|
||||
var_dump($v);
|
||||
}
|
||||
}
|
||||
|
||||
function accept()
|
||||
{
|
||||
return $this->hasChildren() || parent::accept();
|
||||
}
|
||||
}
|
||||
|
||||
$ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz'));
|
||||
|
||||
@@ -46,8 +46,6 @@ array(3) {
|
||||
[2]=>
|
||||
%s(1) "2"
|
||||
}
|
||||
|
||||
Notice: Array to string conversion in %siterator_050.php on line %d
|
||||
int(0)
|
||||
array(2) {
|
||||
[0]=>
|
||||
@@ -69,8 +67,6 @@ array(2) {
|
||||
[1]=>
|
||||
%s(1) "1"
|
||||
}
|
||||
|
||||
Notice: Array to string conversion in %siterator_050.php on line %d
|
||||
object(ArrayIterator)#%d (1) {
|
||||
%s"storage"%s"ArrayIterator":private]=>
|
||||
array(9) {
|
||||
|
||||
@@ -46,18 +46,6 @@ var_dump($ar);
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
int(0)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(1)
|
||||
array(3) {
|
||||
@@ -97,85 +85,11 @@ array(3) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(3)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(4)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
|
||||
Notice: Array to string conversion in %siterator_052.php on line %d
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(5)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(6)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(7)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(8)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(0)
|
||||
array(2) {
|
||||
@@ -231,67 +145,11 @@ array(2) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(3)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(4)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
|
||||
Notice: Array to string conversion in %siterator_052.php on line %d
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(5)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(6)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(7)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(8)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
object(ArrayIterator)#%d (1) {
|
||||
["storage":"ArrayIterator":private]=>
|
||||
array(9) {
|
||||
|
||||
@@ -46,122 +46,14 @@ var_dump($ar);
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
int(0)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(1)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(2)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(3)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(4)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(5)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(6)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(7)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(8)
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[2]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(0)
|
||||
array(2) {
|
||||
@@ -232,20 +124,7 @@ array(2) {
|
||||
string(1) "4"
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
int(5)
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "5"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "5"
|
||||
}
|
||||
}
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(6)
|
||||
array(2) {
|
||||
|
||||
@@ -42,8 +42,6 @@ array(3) {
|
||||
[2]=>
|
||||
string(1) "3"
|
||||
}
|
||||
|
||||
Notice: Array to string conversion in %siterator_054.php on line %d
|
||||
int(7)
|
||||
array(2) {
|
||||
[0]=>
|
||||
|
||||
@@ -21,5 +21,5 @@ $test = new CachingIterator($arrayIterator, 3); // this throws an exception
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_CURRENT
|
||||
Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
|
||||
===DONE===
|
||||
+8
-3
@@ -491,13 +491,18 @@ PHP_FUNCTION(glob)
|
||||
/* now catch the FreeBSD style of "no matches" */
|
||||
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
|
||||
no_results:
|
||||
#ifndef PHP_WIN32
|
||||
/* Paths containing '*', '?' and some other chars are
|
||||
illegal on Windows but legit on other platforms. For
|
||||
this reason the direct basedir check against the glob
|
||||
query is senseless on windows. For instance while *.txt
|
||||
is a pretty valid filename on EXT3, it's invalid on NTFS. */
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
struct stat s;
|
||||
|
||||
if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) {
|
||||
if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
array_init(return_value);
|
||||
return;
|
||||
}
|
||||
|
||||
Loaded 100 of 146 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user