Compare commits

...
104 Commits
Author SHA1 Message Date
Stanislav Malyshev 4c29cabfe0 5.4.27 2014-04-01 22:43:49 -07:00
Remi Collet 67290f51e5 NEWS 2014-03-27 15:24:12 -07:00
Remi Collet 275009cc7c Fixed bug #66946 extensive backtracking in awk rule regular expression
CVE-2013-7345

Applied upstream patch:
https://github.com/file/file/commit/ef2329cf71acb59204dd981e2c6cce6c81fe467c

Add the magicdata.patch to track patches applied to upstream data file.
2014-03-27 15:20:47 -07:00
Remi Collet 9c7690a39e Fixed bug #66946 extensive backtracking in awk rule regular expression
CVE-2013-7345

Applied upstream patch:
https://github.com/file/file/commit/ef2329cf71acb59204dd981e2c6cce6c81fe467c

Add the magicdata.patch to track patches applied to upstream data file.
2014-03-27 15:20:37 -07:00
Stanislav Malyshev 179c7c59ea 5.4.27 rc1 2014-03-18 23:16:57 -07:00
Stanislav Malyshev 8c6be9f40c prep for 5.4.27 rc1 2014-03-18 23:14:18 -07:00
Derick Rethans b30304fb78 - Updated to version 2014.1 (2014a) 2014-03-18 14:48:55 +00:00
Mateusz Kocielski 497b918e62 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed off-by-one in php_url_parse_ex

Conflicts:
	ext/standard/url.c
2014-03-18 08:54:57 +01:00
Mateusz Kocielski 46566b78c9 Fixed off-by-one in php_url_parse_ex
Change order of condition, previously pointer could be derefrenced before
bound check was done.
2014-03-18 08:48:41 +01:00
Remi Collet 87a87c6682 NEWS 2014-03-14 09:51:53 +01:00
Remi Collet 17f6391bf8 Fixed Bug #66833 Default digest algo is still MD5
Switch to SHA1, which match internal openssl hardcoded algo.

In most case, won't even be noticed
- priority on user input (default_md)
- fallback on system config
- fallback on this default value

Recent system reject MD5 digest, noticed in bug36732.phpt failure.

While SHA1 is better than MD5, SHA256 is recommenced,
and defined as default algo in provided configuration on
recent system (Fedora 21, RHEL-7, ...). But the idea is to
keep in sync with openssl internal value for PHP internal value.
2014-03-14 09:50:15 +01:00
Michael Meyer 737c187013 Typo fix: sicret -> secret 2014-03-13 12:37:25 +02:00
Tjerk Meesters ddd7ed9b24 Removed bogus loops 2014-03-11 19:08:18 +08:00
Anatol Belski 1a624e27a6 restored the old code in 5.4/5 related to bug #66872
The crash is reproducable in 5.6+ only, so 5.4 and 5.5 are fine
with the old code.
2014-03-11 11:50:14 +01:00
Christopher Jones 4dc8610d34 Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4
# By Pierre Joye
# Via Pierre Joye
* 'PHP-5.4' of https://git.php.net/repository/php-src:
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)
2014-03-10 16:46:39 -07:00
Pierre Joye 8391277fb8 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Anatol Belski
# Via Anatol Belski
* 'PHP-5.4' of git.php.net:php-src:
  updated libmagic.patch
2014-03-10 16:31:09 +01:00
Anatol Belski b9d494a33b updated libmagic.patch 2014-03-10 14:12:20 +01:00
Pierre Joye 28fa31d6e5 fix #66872, invalid argument crashes gmp_testbit 2014-03-10 12:07:58 +01:00
Pierre Joye af41914e15 fix #66872, invalid argument crashes gmp_testbit 2014-03-10 12:06:40 +01:00
Pierre Joye cedc718f73 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Dmitry Panin (1) and Remi Collet (1)
# Via Nikita Popov
* 'PHP-5.4' of git.php.net:php-src:
  Fix HTML entity table generation
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-10 12:04:04 +01:00
Dmitry Panin e2fc6b52f0 Fix HTML entity table generation 2014-03-06 23:10:31 +01:00
Remi Collet 721b9a7c8d Set default Digest Message to use SHA1 instead of MD5 in openssl tests
as MD5 signature are now rejected by newer openssl Version.

Noticed in RHEL-7 and Fedora 21 build.
2014-03-06 10:14:08 +01:00
Pierre Joye e590aceb5a Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Anatol Belski (22) and others
# Via Derick Rethans (5) and others
* 'PHP-5.4' of git.php.net:php-src: (176 commits)
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
  Improves fix for memory leak, keep in sync with upstream.
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Updated NEWS for #66535
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
  fix tests broken by 633f898f15
  add news entry
  add clear_env option to FPM config
  Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
  Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
  fixed macro
  Make sure value is initialized
  ...
2014-03-05 10:32:42 +01:00
Remi Collet c2a9f73c99 NEWS 2014-03-04 20:35:56 +01:00
Remi Collet a33759fd27 Fixed Bug #66820 out-of-bounds memory access in fileinfo
Upstream fix:
https://github.com/glensc/file/commit/447558595a3650db2886cd2f416ad0beba965801

Notice, test changed, with upstream agreement:
-define OFFSET_OOB(n, o, i)	((n) < (o) || (i) >= ((n) - (o)))
+define OFFSET_OOB(n, o, i)	((n) < (o) || (i) >  ((n) - (o)))
2014-03-04 20:32:52 +01:00
Remi Collet 731013ee8e Improves fix for memory leak, keep in sync with upstream.
Previous fix:
http://git.php.net/?p=php-src.git;a=commitdiff;h=10eb0070700382f966bf260e44135e1f724a15d2

Upstream fix:
https://github.com/glensc/file/commit/c0c0032b9e9eb57b91fefef905a3b018bab492d9
2014-03-04 13:41:37 +01:00
Tjerk Meesters 1533f98afd Updated news for #60602 2014-03-03 05:54:09 +08:00
Tjerk Meesters e73c05b75e proc_open(): separate environment values that aren't strings
Added a test case
2014-03-03 05:49:52 +08:00
Tjerk Meesters 362b70a32c Updated NEWS for #66535 2014-03-01 08:47:32 +08:00
Tjerk Meesters eca13f7909 Fixed test case title 2014-02-28 22:27:32 +08:00
Tjerk Meesters 79b3c2a744 [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
A newline is added to the mail headers when mail.add_x_header is used and no other headers are passed to mail().

The scenario in which custom headers are used was already fixed in #48620, back in 2009.
2014-02-28 22:22:07 +08:00
Remi Collet b1df743b7a man page: long option name is --strip, not --stripped 2014-02-28 08:12:03 +01:00
Remi Collet c73b0543f1 --global have be removed in 5.2 2014-02-28 08:10:01 +01:00
Remi Collet 33d372a45f NEWS 2014-02-27 08:49:08 +01:00
Remi Collet 816a5d2072 test for bug #66762 2014-02-27 08:48:01 +01:00
Remi Collet 9137acc7ec Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
Each new mysqli_stmt now increase the refcount of the link object.
So the link is really destroy after all statements.

Only implemented with libmysqlclient, as mysqlnd already implement
this internally.

So, libmysqlclient and mysqlnd have the same behavior.
2014-02-27 08:45:16 +01:00
Ferenc Kovacs bd961f3e87 fix tests broken by 633f898f15 2014-02-27 02:31:42 +01:00
Antony Dovgal 4d9c556b5d add news entry 2014-02-25 12:14:50 +04:00
Paul Annesley eb6941e902 add clear_env option to FPM config
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
2014-02-25 12:12:09 +04:00
Christopher Jones ee7671afb5 Reduce test noise on cross Oracle client <-> server version tests.
This fix is already in PHP 5.6+
2014-02-24 17:01:30 -08:00
Christopher Jones 8cdefd3d10 Reduce test noise in cross Oracle client <-> server version testing.
This change is already in PHP 5.6+
2014-02-24 16:33:41 -08:00
Anatol Belski c6a4a7cad6 fixed macro 2014-02-24 10:12:18 +01:00
Johannes Schlüter 3f258e6b46 Make sure value is initialized 2014-02-23 14:55:29 +01:00
Johannes Schlüter 756ee95605 We can't dereference dbh if it is NULL 2014-02-23 14:18:24 +01:00
Anatol Belski ce1fd72776 updated libmagic.patch in 5.4/5 2014-02-20 19:00:05 +01:00
Anatol Belski 10eb007070 fixed leak introduced after CVE/upgrade 2014-02-20 18:53:53 +01:00
Bob Weinand afa03a470e Use nicer output for characters < 32 and > 126 in exception strings
Using question marks might confuse more than it helps.
Users are wondering what happened to their string...
2014-02-20 17:39:58 +01:00
Daniel Lowrey 633f898f15 Skip failing tests when EC unavailable (RHEL) 2014-02-19 03:57:37 -07:00
Anatol Belski a289b37f48 updated libmagic.patch 2014-02-18 19:08:16 +01:00
Stanislav Malyshev ee4b3892f8 update news with CVE 2014-02-18 08:36:51 -08:00
Remi Collet 9f449df1e4 NEWS 2014-02-18 13:56:58 +01:00
Remi Collet 89f864c547 Fixed Bug #66731 file: infinite recursion
Upstream commit (available in file-5.17)

https://github.com/glensc/file/commit/3c081560c23f20b2985c285338b52c7aae9fdb0f
https://github.com/glensc/file/commit/cc9e74dfeca5265ad725acc926ef0b8d2a18ee70
2014-02-18 13:54:33 +01:00
Stanislav Malyshev c612440e0f 5.4.27 now 2014-02-17 21:19:25 -08:00
Stanislav Malyshev b79d2285df update NEWS 2014-02-17 21:16:48 -08:00
Daniel Lowrey a80cec1190 Fixed broken build when EC unavailable 2014-02-17 18:55:39 -05:00
Julien Pauli b04159eed4 Updated NEWS for #65753 2014-02-17 11:05:34 +01:00
Julien Pauli 786234d351 Export JsonSerializable Interface (bug #65753) 2014-02-17 10:25:40 +01:00
Yasuo Ohgaki f275fdcf00 Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select() 2014-02-16 10:45:15 +09:00
Yasuo Ohgaki 6f14b5ab41 Refactor build_tablename() 2014-02-16 07:51:27 +09:00
Yasuo Ohgaki 9f251548ae Revise encoding blacklist 2014-02-16 06:21:39 +09:00
Felipe Pena 9d84f6c06e - Fix ZTS build when HAVE_PQESCAPELITERAL is not set 2014-02-15 11:04:49 -02:00
Yasuo Ohgaki 7ce88b2d8a Update NEWS 2014-02-15 19:20:34 +09:00
Yasuo Ohgaki 832c21cabf Refactor and cleanup. WS is cleaned up. Use -b if it is needed.
Added compatibility macros, PQescapeStringConn, PGSQLescapeLiteral/Identifier, PGSQLfree.
2014-02-15 18:20:58 +09:00
Daniel Lowrey 5cc851e83e Update NEWS 2014-02-14 21:41:18 -07:00
mk-j 19524fc6fe Fix for bug66501 - "key type not supported in this PHP build" 2014-02-14 18:11:46 -07:00
Veres Lajos 35101e9ef4 a few typofixes 2014-02-14 14:51:10 +02:00
Mats Lindh 6188674f1e Replace old SVN references to Git 2014-02-09 21:17:26 +02:00
Anatol Belski e41059c633 update libs_version.txt 2014-02-06 09:13:05 +01:00
Hannes Magnusson 1e0fdf0256 Fix year 2014-02-05 10:15:11 -08:00
Anatol Belski 71ebc0a7f3 adapt test to curl 7.35.0 upgrade
which is a security one and should be performed as in
http://curl.haxx.se/docs/adv_20140129.html
2014-02-05 15:15:34 +01:00
Stanislav Malyshev 770aeeb40c tests still failing, so xfail for now until fixed 2014-01-29 23:48:07 -08:00
Yasuo Ohgaki f5e097d1ed Fixed bug data->fd not set to -1 for open_basedir failure. 2014-01-30 14:15:29 +09:00
Yasuo Ohgaki d941ac5b4f Fixed zend.multibyte tests partially 2014-01-29 15:41:30 +09:00
Andrey Hristov 79cbcd9ded add text for the new constants 2014-01-28 15:32:59 +02:00
Andrey Hristov eafe070f86 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4 2014-01-28 15:23:54 +02:00
Andrey Hristov d3faae03ec add new consts 2014-01-28 15:23:41 +02:00
Bob Weinand e9b4bca5a0 Fixed arginfo of PDO::__construct() to match the docs and zend_parse_parameters definition. 2014-01-28 13:31:52 +01:00
Yasuo Ohgaki 4dee63ca1c Remove obsolete description 2014-01-27 18:41:31 +09:00
Yasuo Ohgaki d65ddb633d Fix English and improve by Stas. Thanks :) 2014-01-26 17:20:13 -08:00
Yasuo Ohgaki f496aac1f6 Update source docs 2014-01-26 17:20:12 -08:00
Yasuo Ohgaki 76c098395d Revert "Update source docs"
This reverts commit 10d06cd4ff3038d2f02a18936793969e7aee0bda.
2014-01-26 17:20:12 -08:00
Yasuo Ohgaki 60bcf84dda Update source docs 2014-01-26 17:20:12 -08:00
Stanislav Malyshev d5560faaa3 drop precision since trigonometric functions are non-portable
See: http://stackoverflow.com/questions/21212326/floating-point-arithmetic-and-reproducibility
2014-01-26 15:51:17 -08:00
Stanislav Malyshev f49965b487 XFAIL multibyte tests until they are fixed (bug 66582) 2014-01-26 15:51:17 -08:00
Derick Rethans 251b914afa Merge branch '45543-timezone-set' into PHP-5.4 2014-01-26 14:02:19 +01:00
Derick Rethans 22dba2f5f3 Fixed bug #45543: DateTime::setTimezone can not set timezones without ID. 2014-01-26 14:01:58 +01:00
Stanislav Malyshev 4e308abf28 fix test bug62479.phpt 2014-01-25 23:25:39 -08:00
Stanislav Malyshev 0742de587a Merge branch 'pull-request/571' into PHP-5.4
* pull-request/571:
  Implement ldap_modify_batch.
2014-01-25 21:59:57 -08:00
Derick Rethans fb16bff2ba Merge branch '44780-fallback' into PHP-5.4 2014-01-25 16:15:50 +01:00
Derick Rethans e6ab180394 Fixed bug #44780: some time zone offsets not recognized by timezone_name_from_abbr. 2014-01-25 16:14:51 +01:00
Ferenc Kovacs 69af357182 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix the primary qa email address and update the list of available people being able to add moderators to our lists
  Revert "Fix #62479: Some chars not parsed in passwords"
  Fix #62479: Some chars not parsed in passwords
2014-01-24 16:07:29 +01:00
Ferenc Kovacs 4b48b29988 fix the primary qa email address and update the list of available people being able to add moderators to our lists 2014-01-24 16:06:58 +01:00
Will Fitch c4c10a222e Update gitignore and Makefile for additional entries 2014-01-23 21:28:45 -05:00
Ondřej Hošek c0e3429904 Implement ldap_modify_batch. 2014-01-22 18:54:11 +01:00
Anatol Belski 0eff7176de fixed test 2014-01-22 15:39:49 +01:00
Anatol Belski 34792280bc fix zts 2014-01-22 12:03:54 +01:00
Anatol Belski 7bcf01f39a fixed missing usleep() prototype in pgsql 2014-01-22 11:52:52 +01:00
Yasuo Ohgaki 58f94345a7 Fixed previous commit may delete unwanted cookies. Sync tests from upper branches. 2014-01-22 19:21:25 +09:00
Yasuo Ohgaki a27e51fd4e Re-fixed bug #66469 2014-01-22 13:40:58 +09:00
Stanislav Malyshev 1bc16fbfcd fix CVE ref for bug #66060 2014-01-21 13:26:56 -08:00
Stanislav Malyshev ac6bd1e346 5.4.26 next 2014-01-21 12:13:42 -08:00
Will Fitch 8aa93b7f2c Revert "Fix #62479: Some chars not parsed in passwords"
This reverts commit e6bb90c66a.
2014-01-19 13:02:20 -05:00
Will Fitch e6bb90c66a Fix #62479: Some chars not parsed in passwords
This fixes an issue where backslashes and spaces aren't
correctly parsed for passwords.
2014-01-18 19:27:00 -05:00
Pierre Joye 9b54901ffb add vc12 (2013) 2013-11-04 22:19:02 +01:00
101 changed files with 23496 additions and 22158 deletions

No files matched your search

+4
View File
@@ -204,6 +204,8 @@ ext/pdo_sqlite/sqlite3.h
ext/pdo_sqlite/tests/*.db
ext/pdo_sqlite/tests/*.tmp
ext/phar/phar.phar
ext/phar/phar.1
ext/phar/phar.phar.1
ext/pspell/tests/*.tmp
ext/reflection/xml
ext/reflection/html
@@ -235,12 +237,14 @@ sapi/apache/libphp5.module
sapi/apache2handler/libphp5.module
sapi/apache_hooks/libphp5.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
sapi/fpm/php-fpm
sapi/fpm/php-fpm.1
sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.conf
sapi/fpm/fpm/php-cgi
sapi/phpdbg/phpdbg
scripts/php-config
scripts/phpize
scripts/man1/*.1
+23 -3
View File
@@ -82,7 +82,7 @@ Exceptions:
library may need to control or free the memory, or when the memory in
question needs to survive between multiple requests.
Naming Conventions
User Functions/Methods Naming Conventions
------------------
1. Function names for user-level functions should be enclosed with in
@@ -163,6 +163,26 @@ Naming Conventions
'foobar'
'foo_bar'
Internal Function Naming Convensions
----------------------
1. Functions that are part of the external API should be named
'php_modulename_function()' to avoid symbol collision. They should be in
lowercase, with words underscore delimited. Exposed API must be defined
in 'php_modulename.h'.
PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS);
Unexposed module function should be static and should not be defined in
'php_modulename.h'.
static int php_session_destroy(TSRMLS_D)
2. Main module source file must be named 'modulename.c'.
3. Header file that is used by other sources must be named 'php_modulename.h'.
Syntax and indentation
----------------------
@@ -181,9 +201,9 @@ Syntax and indentation
of PHP or one of its standard modules, please maintain the K&R
style. This applies to just about everything, starting with
indentation and comment styles and up to function declaration
syntax. Also see Indentstyle_.
syntax. Also see Indentstyle.
.. _Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html
Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html
3. Be generous with whitespace and braces. Keep one empty line between the
variable declaration section and the statements in a block, as well as
+1
View File
@@ -113,6 +113,7 @@ clean:
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
find . -name \*.1 | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
+53 -4
View File
@@ -1,13 +1,61 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.4.25
03 Apr 2014, PHP 5.4.27
- Core:
. Fixed bug #60602 (proc_open() changes environment array) (Tjerk)
- Fileinfo:
. Fixed bug #66946 (fileinfo: extensive backtracking in awk rule regular
expression). (CVE-2013-7345) (Remi)
- FPM:
. Added clear_env configuration directive to disable clearenv() call.
(Github PR# 598, Paul Annesley)
- GMP
. fixed bug#66872 (invalid argument crashes gmp_testbit) (Pierre)
- Mail:
. Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk)
- MySQLi:
. Fixed bug #66762 (Segfault in mysqli_stmt::bind_result() when link closed)
(Remi)
- Openssl:
. Fixed bug #66833 (Default disgest algo is still MD5, switch to SHA1). (Remi)
06 Mar 2014, PHP 5.4.26
- JSON:
. Fixed bug #65753 (JsonSerializeable couldn't implement on module extension)
(chobieeee@php.net)
- Fileinfo:
. Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi)
. Fixed bug #66820 (out-of-bounds memory access in fileinfo). (Remi)
- LDAP:
. Implemented ldap_modify_batch (https://wiki.php.net/rfc/ldap_modify_batch).
(Ondřej Hošek)
- Openssl:
. Fixed bug #66501 (Add EC key support to php_openssl_is_private_key).
(Mark Zedwood)
- Pgsql:
. Added warning for dangerous client encoding and remove possible injections
for pg_insert()/pg_update()/pg_delete()/pg_select(). (Yasuo)
06 Feb 2014, PHP 5.4.25
- Core:
. Fixed bug #66286 (Incorrect object comparison with inheritance). (Nikita)
. Fixed bug #66509 (copy() arginfo has changed starting from 5.4).
(Will Fitch)
- mysqlnd
- mysqlnd:
. Fixed bug #66283 (Segmentation fault after memory_limit). (Johannes)
- PDO_pgsql:
@@ -18,7 +66,7 @@ PHP NEWS
. Fixed bug #66481 (Calls to session_name() segfault when session.name is
null). (Laruence)
10 Jan 2013, PHP 5.4.24
10 Jan 2014, PHP 5.4.24
- Core:
. Added validation of class names in the autoload process. (Dmitry)
@@ -26,7 +74,8 @@ PHP NEWS
. Fixed bug #61645 (fopen and O_NONBLOCK). (Mike)
- Date:
. Fixed bug #66060 (Heap buffer over-read in DateInterval). (Remi)
. Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712)
(Remi)
. Fixed bug #63391 (Incorrect/inconsistent day of week prior to the year
1600). (Derick, T. Carter)
. Fixed bug #61599 (Wrong Day of Week). (Derick, T. Carter)
+8
View File
@@ -1,3 +1,11 @@
This file describes extension module API details. Refer to
README.EXT_SKEL to create extension skeleton files. Refer to
Hacker's Guide for PHP internals.
http://www.php.net/manual/en/internals2.php
Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way
that broke both source and binary compatibility. If you are
maintaining a third party extension, here's how to update it:
+24 -6
View File
@@ -45,12 +45,29 @@ HOW TO USE IT
--proto=filename.
SOURCE AND HEADER FILE NAME
./ext_skel generates 'module_name.c' and 'php_module_name.h' as main source
and header files. Keep these names.
Module functions (User functions) must be named
module_name_function()
When you need to expose module functions to other modules, expose functions
strictly needed by others. Exposed internal function must be named
php_module_name_function()
See also CODING_STANDARDS.
FORMAT OF FUNCTION DEFINITIONS FILE
All the definitions must be on one line. In it's simplest form, it's just
the function name, e.g.
my_function
module_name_function
but then you'll be left with an almost empty function body without any
argument handling.
@@ -72,8 +89,9 @@ FORMAT OF FUNCTION DEFINITIONS FILE
An example:
my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
module_name_function(int arg1, int arg2 [, int arg3 [, int arg4]])
Arguments arg1 and arg2 are required.
Arguments arg3 and arg4 are optional.
If possible, the function definition should also contain it's return type
@@ -133,15 +151,15 @@ EXAMPLE
The following _one_ line
bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
will create this function definition for you (note that there are a few
question marks to be replaced by you, and you must of course add your own
value definitions too):
/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
/* {{{ proto bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
*/
PHP_FUNCTION(my_drawtext)
PHP_FUNCTION(module_name_drawtext)
{
char *text = NULL;
int argc = ZEND_NUM_ARGS();
@@ -164,7 +182,7 @@ PHP_FUNCTION(my_drawtext)
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id);
}
php_error(E_WARNING, "my_drawtext: not yet implemented");
php_error(E_WARNING, "module_name_drawtext: not yet implemented");
}
/* }}} */
+3 -3
View File
@@ -101,10 +101,10 @@ pointing out "the location of the release" and "the possible release date of
either the next RC, or the final release".
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
``php-qa@lists.php.net`` and ``primary-qa-tests@lists.php.net``.
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
This email is to notify the selected projects about a new release so that they
can make sure their projects keep working. Make sure that you have been setup
as a moderator for ``primary-qa-tests@lists.php.net`` by having someone (Wez,
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
Derick) run the following commands for you:
``ssh lists.php.net``
@@ -139,7 +139,7 @@ Rolling a stable release
1. Checkout your release branch, you should have created when releasing previous RC
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
2. If a CVE commit needs to be merged to the release, then have it commited to
2. If a CVE commit needs to be merged to the release, then have it committed to
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
Don't forget to update NEWS manually in an extra commit then.
+11
View File
@@ -50,6 +50,17 @@ Please make the mail subject prefix "[PATCH]". If attaching a patch,
ensure it has a file extension of ".txt". This is because only MIME
attachments of type 'text/*' are accepted.
The preferred way to propose PHP patch is sending pull request from
github.
https://github.com/php/php-src
Fork the official PHP repository and send a pull request. A
notification will be sent to the pull request mailing list. Sending a
note to PHP Internals list (internals@lists.php.net) may help getting
more feedback and quicker turnaround. You can also add pull requests
to bug reports at http://bugs.php.net/.
PHP Documentation Patches
-------------------------
+1 -1
View File
@@ -2,7 +2,7 @@
#define TSRM_CONFIG_COMMON_H
#ifndef __CYGWIN__
# if WINNT|WIN32
# ifdef _WIN32
# define TSRM_WIN32
# endif
#endif
+1
View File
@@ -621,6 +621,7 @@ c. New functions
- LDAP:
- ldap_control_paged_result()
- ldap_control_paged_result_response()
- ldap_modify_batch (5.4.26)
- libxml:
- libxml_set_external_entity_loader()
+58 -3
View File
@@ -360,6 +360,11 @@ ZEND_METHOD(error_exception, getSeverity)
} \
}
#define TRACE_ARG_APPEND(vallen) \
*str = (char*)erealloc(*str, *len + 1 + vallen); \
memcpy((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
/* }}} */
static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
@@ -371,7 +376,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
len = va_arg(args, int*);
/* the trivial way would be to do:
* conver_to_string_ex(arg);
* convert_to_string_ex(arg);
* append it and kill the now tmp arg.
* but that could cause some E_NOTICE and also damn long lines.
*/
@@ -394,8 +399,58 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
l_added += 3 + 1;
}
while (--l_added) {
if ((*str)[*len - l_added] < 32) {
(*str)[*len - l_added] = '?';
unsigned char chr = (*str)[*len - l_added];
if (chr < 32 || chr == '\\' || chr > 126) {
(*str)[*len - l_added] = '\\';
switch (chr) {
case '\n':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'n';
break;
case '\r':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'r';
break;
case '\t':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 't';
break;
case '\f':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'f';
break;
case '\v':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'v';
break;
#ifndef PHP_WIN32
case '\e':
#else
case VK_ESCAPE:
#endif
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'e';
break;
case '\\':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = '\\';
break;
default:
TRACE_ARG_APPEND(3);
(*str)[*len - l_added + 1] = 'x';
if ((chr >> 4) < 10) {
(*str)[*len - l_added + 2] = (chr >> 4) + '0';
} else {
(*str)[*len - l_added + 2] = (chr >> 4) + 'A' - 10;
}
if (chr % 16 < 10) {
(*str)[*len - l_added + 3] = chr % 16 + '0';
} else {
(*str)[*len - l_added + 3] = chr % 16 + 'A' - 10;
}
*len += 3;
}
}
}
break;
+1 -1
View File
@@ -57,7 +57,7 @@ ZEND_API void zend_html_putc(char c)
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
{
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
unsigned char *filtered;
unsigned char *filtered = NULL;
size_t filtered_len;
if (LANG_SCNG(output_filter)) {
+2 -2
View File
@@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
echo " to build PHP from Git."
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
echo " to build PHP from Git."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=25
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=27
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`
+1 -3
View File
@@ -17,9 +17,7 @@ open_basedir="c:/tmp"
?>
--EXPECTF--
%a
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
bool(true)
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
+42 -40
View File
@@ -1,40 +1,42 @@
{ "sst", 0, -11, "Pacific/Apia" },
{ "hst", 0, -10, "Pacific/Honolulu" },
{ "akst", 0, -9, "America/Anchorage" },
{ "akdt", 1, -8, "America/Anchorage" },
{ "pst", 0, -8, "America/Los_Angeles" },
{ "pdt", 1, -7, "America/Los_Angeles" },
{ "mst", 0, -7, "America/Denver" },
{ "mdt", 1, -6, "America/Denver" },
{ "cst", 0, -6, "America/Chicago" },
{ "cdt", 1, -5, "America/Chicago" },
{ "est", 0, -5, "America/New_York" },
{ "edt", 1, -4, "America/New_York" },
{ "ast", 0, -4, "America/Halifax" },
{ "adt", 1, -3, "America/Halifax" },
{ "brt", 0, -3, "America/Sao_Paulo" },
{ "brst", 1, -2, "America/Sao_Paulo" },
{ "azost", 0, -1, "Atlantic/Azores" },
{ "azodt", 1, 0, "Atlantic/Azores" },
{ "gmt", 0, 0, "Europe/London" },
{ "bst", 1, 1, "Europe/London" },
{ "cet", 0, 1, "Europe/Paris" },
{ "cest", 1, 2, "Europe/Paris" },
{ "eet", 0, 2, "Europe/Helsinki" },
{ "eest", 1, 3, "Europe/Helsinki" },
{ "msk", 0, 3, "Europe/Moscow" },
{ "msd", 1, 4, "Europe/Moscow" },
{ "gst", 0, 4, "Asia/Dubai" },
{ "pkt", 0, 5, "Asia/Karachi" },
{ "ist", 0, 5.5, "Asia/Kolkata" },
{ "npt", 0, 5.75, "Asia/Katmandu" },
{ "yekt", 1, 6, "Asia/Yekaterinburg" },
{ "novst", 1, 7, "Asia/Novosibirsk" },
{ "krat", 0, 7, "Asia/Krasnoyarsk" },
{ "krast", 1, 8, "Asia/Krasnoyarsk" },
{ "jst", 0, 9, "Asia/Tokyo" },
{ "est", 0, 10, "Australia/Melbourne" },
{ "cst", 1, 10.5, "Australia/Adelaide" },
{ "est", 1, 11, "Australia/Melbourne" },
{ "nzst", 0, 12, "Pacific/Auckland" },
{ "nzdt", 1, 13, "Pacific/Auckland" },
{ "sst", 0, -660, "Pacific/Apia" },
{ "hst", 0, -600, "Pacific/Honolulu" },
{ "akst", 0, -540, "America/Anchorage" },
{ "akdt", 1, -480, "America/Anchorage" },
{ "pst", 0, -480, "America/Los_Angeles" },
{ "pdt", 1, -420, "America/Los_Angeles" },
{ "mst", 0, -420, "America/Denver" },
{ "mdt", 1, -360, "America/Denver" },
{ "cst", 0, -360, "America/Chicago" },
{ "cdt", 1, -300, "America/Chicago" },
{ "est", 0, -300, "America/New_York" },
{ "vet", 0, -270, "America/Caracas" },
{ "edt", 1, -240, "America/New_York" },
{ "ast", 0, -240, "America/Halifax" },
{ "adt", 1, -180, "America/Halifax" },
{ "brt", 0, -180, "America/Sao_Paulo" },
{ "brst", 1, -120, "America/Sao_Paulo" },
{ "azost", 0, -60, "Atlantic/Azores" },
{ "azodt", 1, 0, "Atlantic/Azores" },
{ "gmt", 0, 0, "Europe/London" },
{ "bst", 1, 60, "Europe/London" },
{ "cet", 0, 60, "Europe/Paris" },
{ "cest", 1, 120, "Europe/Paris" },
{ "eet", 0, 120, "Europe/Helsinki" },
{ "eest", 1, 180, "Europe/Helsinki" },
{ "msk", 0, 180, "Europe/Moscow" },
{ "msd", 1, 240, "Europe/Moscow" },
{ "gst", 0, 240, "Asia/Dubai" },
{ "pkt", 0, 300, "Asia/Karachi" },
{ "ist", 0, 330, "Asia/Kolkata" },
{ "npt", 0, 345, "Asia/Katmandu" },
{ "yekt", 1, 360, "Asia/Yekaterinburg" },
{ "novst", 1, 420, "Asia/Novosibirsk" },
{ "krat", 0, 420, "Asia/Krasnoyarsk" },
{ "cst", 0, 480, "Asia/Shanghai" },
{ "krast", 1, 480, "Asia/Krasnoyarsk" },
{ "jst", 0, 540, "Asia/Tokyo" },
{ "est", 0, 600, "Australia/Melbourne" },
{ "cst", 1, 630, "Australia/Adelaide" },
{ "est", 1, 660, "Australia/Melbourne" },
{ "nzst", 0, 720, "Pacific/Auckland" },
{ "nzdt", 1, 780, "Pacific/Auckland" },
+3 -3
View File
@@ -1,10 +1,10 @@
/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */
/* Generated by re2c 0.13.5 on Sat Jan 25 15:48:30 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
| Copyright (c) 1997-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -752,7 +752,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) {
if ((fmp->gmtoffset * 60) == gmtoffset && fmp->type == isdst) {
return fmp;
}
}
+1 -1
View File
@@ -750,7 +750,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) {
if ((fmp->gmtoffset * 60) == gmtoffset && fmp->type == isdst) {
return fmp;
}
}
+2
View File
@@ -91,6 +91,8 @@ int timelib_apply_localtime(timelib_time *t, unsigned int localtime);
void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts);
void timelib_unixtime2local(timelib_time *tm, timelib_sll ts);
void timelib_update_from_sse(timelib_time *tm);
void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset);
void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info);
void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz);
/* From parse_tz.c */
+6
View File
@@ -172,6 +172,12 @@ typedef struct timelib_time {
* 2 TimeZone abbreviation */
} timelib_time;
typedef struct timelib_abbr_info {
timelib_sll utc_offset;
char *abbr;
int dst;
} timelib_abbr_info;
typedef struct timelib_error_message {
int position;
char character;
+207 -207
View File
@@ -435,152 +435,152 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = {
{ "Europe/Jersey" , 0x02EA09 },
{ "Europe/Kaliningrad" , 0x02EF40 },
{ "Europe/Kiev" , 0x02F1A6 },
{ "Europe/Lisbon" , 0x02F4BD },
{ "Europe/Ljubljana" , 0x02F9C1 },
{ "Europe/London" , 0x02FC8A },
{ "Europe/Luxembourg" , 0x0301C1 },
{ "Europe/Madrid" , 0x030617 },
{ "Europe/Malta" , 0x0309DD },
{ "Europe/Mariehamn" , 0x030D96 },
{ "Europe/Minsk" , 0x03104C },
{ "Europe/Monaco" , 0x03125A },
{ "Europe/Moscow" , 0x031695 },
{ "Europe/Nicosia" , 0x0318E6 },
{ "Europe/Oslo" , 0x031BCE },
{ "Europe/Paris" , 0x031F00 },
{ "Europe/Podgorica" , 0x032346 },
{ "Europe/Prague" , 0x03260F },
{ "Europe/Riga" , 0x032941 },
{ "Europe/Rome" , 0x032C86 },
{ "Europe/Samara" , 0x033049 },
{ "Europe/San_Marino" , 0x03327C },
{ "Europe/Sarajevo" , 0x03363F },
{ "Europe/Simferopol" , 0x033908 },
{ "Europe/Skopje" , 0x033C33 },
{ "Europe/Sofia" , 0x033EFC },
{ "Europe/Stockholm" , 0x034204 },
{ "Europe/Tallinn" , 0x0344B3 },
{ "Europe/Tirane" , 0x0347ED },
{ "Europe/Tiraspol" , 0x034AF3 },
{ "Europe/Uzhgorod" , 0x034E81 },
{ "Europe/Vaduz" , 0x035198 },
{ "Europe/Vatican" , 0x035447 },
{ "Europe/Vienna" , 0x03580A },
{ "Europe/Vilnius" , 0x035B37 },
{ "Europe/Volgograd" , 0x035E76 },
{ "Europe/Warsaw" , 0x036076 },
{ "Europe/Zagreb" , 0x036457 },
{ "Europe/Zaporozhye" , 0x036720 },
{ "Europe/Zurich" , 0x036A61 },
{ "Factory" , 0x036D10 },
{ "GB" , 0x036D81 },
{ "GB-Eire" , 0x0372B8 },
{ "GMT" , 0x0377EF },
{ "GMT+0" , 0x0378BB },
{ "GMT-0" , 0x037877 },
{ "GMT0" , 0x037833 },
{ "Greenwich" , 0x0378FF },
{ "Hongkong" , 0x037943 },
{ "HST" , 0x037B05 },
{ "Iceland" , 0x037B49 },
{ "Indian/Antananarivo" , 0x037D02 },
{ "Indian/Chagos" , 0x037D76 },
{ "Indian/Christmas" , 0x037DD8 },
{ "Indian/Cocos" , 0x037E1C },
{ "Indian/Comoro" , 0x037E60 },
{ "Indian/Kerguelen" , 0x037EB5 },
{ "Indian/Mahe" , 0x037F0A },
{ "Indian/Maldives" , 0x037F5F },
{ "Indian/Mauritius" , 0x037FB4 },
{ "Indian/Mayotte" , 0x03802A },
{ "Indian/Reunion" , 0x03807F },
{ "Iran" , 0x0380D4 },
{ "Israel" , 0x038342 },
{ "Jamaica" , 0x038671 },
{ "Japan" , 0x038736 },
{ "Kwajalein" , 0x0387BF },
{ "Libya" , 0x038822 },
{ "MET" , 0x03892B },
{ "Mexico/BajaNorte" , 0x038C34 },
{ "Mexico/BajaSur" , 0x038F9D },
{ "Mexico/General" , 0x0391E2 },
{ "MST" , 0x039440 },
{ "MST7MDT" , 0x039484 },
{ "Navajo" , 0x0397D5 },
{ "NZ" , 0x039B4E },
{ "NZ-CHAT" , 0x039ECC },
{ "Pacific/Apia" , 0x03A1B4 },
{ "Pacific/Auckland" , 0x03A350 },
{ "Pacific/Chatham" , 0x03A6DC },
{ "Pacific/Chuuk" , 0x03A9D3 },
{ "Pacific/Easter" , 0x03AA2C },
{ "Pacific/Efate" , 0x03AD8A },
{ "Pacific/Enderbury" , 0x03AE50 },
{ "Pacific/Fakaofo" , 0x03AEBE },
{ "Pacific/Fiji" , 0x03AF0F },
{ "Pacific/Funafuti" , 0x03B0A2 },
{ "Pacific/Galapagos" , 0x03B0E6 },
{ "Pacific/Gambier" , 0x03B15E },
{ "Pacific/Guadalcanal" , 0x03B1C3 },
{ "Pacific/Guam" , 0x03B218 },
{ "Pacific/Honolulu" , 0x03B26E },
{ "Pacific/Johnston" , 0x03B2E5 },
{ "Pacific/Kiritimati" , 0x03B364 },
{ "Pacific/Kosrae" , 0x03B3CF },
{ "Pacific/Kwajalein" , 0x03B42C },
{ "Pacific/Majuro" , 0x03B498 },
{ "Pacific/Marquesas" , 0x03B4F7 },
{ "Pacific/Midway" , 0x03B55E },
{ "Pacific/Nauru" , 0x03B5E8 },
{ "Pacific/Niue" , 0x03B660 },
{ "Pacific/Norfolk" , 0x03B6BE },
{ "Pacific/Noumea" , 0x03B713 },
{ "Pacific/Pago_Pago" , 0x03B7A3 },
{ "Pacific/Palau" , 0x03B82C },
{ "Pacific/Pitcairn" , 0x03B870 },
{ "Pacific/Pohnpei" , 0x03B8C5 },
{ "Pacific/Ponape" , 0x03B91A },
{ "Pacific/Port_Moresby" , 0x03B95F },
{ "Pacific/Rarotonga" , 0x03B9A3 },
{ "Pacific/Saipan" , 0x03BA7F },
{ "Pacific/Samoa" , 0x03BAE2 },
{ "Pacific/Tahiti" , 0x03BB6B },
{ "Pacific/Tarawa" , 0x03BBD0 },
{ "Pacific/Tongatapu" , 0x03BC24 },
{ "Pacific/Truk" , 0x03BCB0 },
{ "Pacific/Wake" , 0x03BCF5 },
{ "Pacific/Wallis" , 0x03BD45 },
{ "Pacific/Yap" , 0x03BD89 },
{ "Poland" , 0x03BDCE },
{ "Portugal" , 0x03C1AF },
{ "PRC" , 0x03C6AB },
{ "PST8PDT" , 0x03C75C },
{ "ROC" , 0x03CAAD },
{ "ROK" , 0x03CBC5 },
{ "Singapore" , 0x03CC69 },
{ "Turkey" , 0x03CD20 },
{ "UCT" , 0x03D10D },
{ "Universal" , 0x03D151 },
{ "US/Alaska" , 0x03D195 },
{ "US/Aleutian" , 0x03D4FE },
{ "US/Arizona" , 0x03D864 },
{ "US/Central" , 0x03D8F2 },
{ "US/East-Indiana" , 0x03E2FC },
{ "US/Eastern" , 0x03DDFD },
{ "US/Hawaii" , 0x03E566 },
{ "US/Indiana-Starke" , 0x03E5D7 },
{ "US/Michigan" , 0x03E948 },
{ "US/Mountain" , 0x03EC7F },
{ "US/Pacific" , 0x03EFF8 },
{ "US/Pacific-New" , 0x03F3FD },
{ "US/Samoa" , 0x03F802 },
{ "UTC" , 0x03F88B },
{ "W-SU" , 0x03FB82 },
{ "WET" , 0x03F8CF },
{ "Zulu" , 0x03FDBC },
{ "Europe/Lisbon" , 0x02F4C2 },
{ "Europe/Ljubljana" , 0x02F9C6 },
{ "Europe/London" , 0x02FC8F },
{ "Europe/Luxembourg" , 0x0301C6 },
{ "Europe/Madrid" , 0x03061C },
{ "Europe/Malta" , 0x0309E2 },
{ "Europe/Mariehamn" , 0x030D9B },
{ "Europe/Minsk" , 0x031051 },
{ "Europe/Monaco" , 0x03125F },
{ "Europe/Moscow" , 0x03169A },
{ "Europe/Nicosia" , 0x0318EB },
{ "Europe/Oslo" , 0x031BD3 },
{ "Europe/Paris" , 0x031F05 },
{ "Europe/Podgorica" , 0x03234B },
{ "Europe/Prague" , 0x032614 },
{ "Europe/Riga" , 0x032946 },
{ "Europe/Rome" , 0x032C8B },
{ "Europe/Samara" , 0x03304E },
{ "Europe/San_Marino" , 0x033281 },
{ "Europe/Sarajevo" , 0x033644 },
{ "Europe/Simferopol" , 0x03390D },
{ "Europe/Skopje" , 0x033C38 },
{ "Europe/Sofia" , 0x033F01 },
{ "Europe/Stockholm" , 0x034209 },
{ "Europe/Tallinn" , 0x0344B8 },
{ "Europe/Tirane" , 0x0347F2 },
{ "Europe/Tiraspol" , 0x034AF8 },
{ "Europe/Uzhgorod" , 0x034E86 },
{ "Europe/Vaduz" , 0x03519D },
{ "Europe/Vatican" , 0x03544C },
{ "Europe/Vienna" , 0x03580F },
{ "Europe/Vilnius" , 0x035B3C },
{ "Europe/Volgograd" , 0x035E7B },
{ "Europe/Warsaw" , 0x03607B },
{ "Europe/Zagreb" , 0x03645C },
{ "Europe/Zaporozhye" , 0x036725 },
{ "Europe/Zurich" , 0x036A66 },
{ "Factory" , 0x036D15 },
{ "GB" , 0x036D86 },
{ "GB-Eire" , 0x0372BD },
{ "GMT" , 0x0377F4 },
{ "GMT+0" , 0x0378C0 },
{ "GMT-0" , 0x03787C },
{ "GMT0" , 0x037838 },
{ "Greenwich" , 0x037904 },
{ "Hongkong" , 0x037948 },
{ "HST" , 0x037B0A },
{ "Iceland" , 0x037B4E },
{ "Indian/Antananarivo" , 0x037D07 },
{ "Indian/Chagos" , 0x037D7B },
{ "Indian/Christmas" , 0x037DDD },
{ "Indian/Cocos" , 0x037E21 },
{ "Indian/Comoro" , 0x037E65 },
{ "Indian/Kerguelen" , 0x037EBA },
{ "Indian/Mahe" , 0x037F0F },
{ "Indian/Maldives" , 0x037F64 },
{ "Indian/Mauritius" , 0x037FB9 },
{ "Indian/Mayotte" , 0x03802F },
{ "Indian/Reunion" , 0x038084 },
{ "Iran" , 0x0380D9 },
{ "Israel" , 0x038347 },
{ "Jamaica" , 0x038676 },
{ "Japan" , 0x03873B },
{ "Kwajalein" , 0x0387C4 },
{ "Libya" , 0x038827 },
{ "MET" , 0x038930 },
{ "Mexico/BajaNorte" , 0x038C39 },
{ "Mexico/BajaSur" , 0x038FA2 },
{ "Mexico/General" , 0x0391E7 },
{ "MST" , 0x039445 },
{ "MST7MDT" , 0x039489 },
{ "Navajo" , 0x0397DA },
{ "NZ" , 0x039B53 },
{ "NZ-CHAT" , 0x039ED1 },
{ "Pacific/Apia" , 0x03A1B9 },
{ "Pacific/Auckland" , 0x03A355 },
{ "Pacific/Chatham" , 0x03A6E1 },
{ "Pacific/Chuuk" , 0x03A9D8 },
{ "Pacific/Easter" , 0x03AA31 },
{ "Pacific/Efate" , 0x03AD8F },
{ "Pacific/Enderbury" , 0x03AE55 },
{ "Pacific/Fakaofo" , 0x03AEC3 },
{ "Pacific/Fiji" , 0x03AF14 },
{ "Pacific/Funafuti" , 0x03B0A7 },
{ "Pacific/Galapagos" , 0x03B0EB },
{ "Pacific/Gambier" , 0x03B163 },
{ "Pacific/Guadalcanal" , 0x03B1C8 },
{ "Pacific/Guam" , 0x03B21D },
{ "Pacific/Honolulu" , 0x03B273 },
{ "Pacific/Johnston" , 0x03B2EA },
{ "Pacific/Kiritimati" , 0x03B369 },
{ "Pacific/Kosrae" , 0x03B3D4 },
{ "Pacific/Kwajalein" , 0x03B431 },
{ "Pacific/Majuro" , 0x03B49D },
{ "Pacific/Marquesas" , 0x03B4FC },
{ "Pacific/Midway" , 0x03B563 },
{ "Pacific/Nauru" , 0x03B5ED },
{ "Pacific/Niue" , 0x03B665 },
{ "Pacific/Norfolk" , 0x03B6C3 },
{ "Pacific/Noumea" , 0x03B718 },
{ "Pacific/Pago_Pago" , 0x03B7A8 },
{ "Pacific/Palau" , 0x03B831 },
{ "Pacific/Pitcairn" , 0x03B875 },
{ "Pacific/Pohnpei" , 0x03B8CA },
{ "Pacific/Ponape" , 0x03B91F },
{ "Pacific/Port_Moresby" , 0x03B964 },
{ "Pacific/Rarotonga" , 0x03B9A8 },
{ "Pacific/Saipan" , 0x03BA84 },
{ "Pacific/Samoa" , 0x03BAE7 },
{ "Pacific/Tahiti" , 0x03BB70 },
{ "Pacific/Tarawa" , 0x03BBD5 },
{ "Pacific/Tongatapu" , 0x03BC29 },
{ "Pacific/Truk" , 0x03BCB5 },
{ "Pacific/Wake" , 0x03BCFA },
{ "Pacific/Wallis" , 0x03BD4A },
{ "Pacific/Yap" , 0x03BD8E },
{ "Poland" , 0x03BDD3 },
{ "Portugal" , 0x03C1B4 },
{ "PRC" , 0x03C6B0 },
{ "PST8PDT" , 0x03C761 },
{ "ROC" , 0x03CAB2 },
{ "ROK" , 0x03CBCA },
{ "Singapore" , 0x03CC6E },
{ "Turkey" , 0x03CD25 },
{ "UCT" , 0x03D112 },
{ "Universal" , 0x03D156 },
{ "US/Alaska" , 0x03D19A },
{ "US/Aleutian" , 0x03D503 },
{ "US/Arizona" , 0x03D869 },
{ "US/Central" , 0x03D8F7 },
{ "US/East-Indiana" , 0x03E301 },
{ "US/Eastern" , 0x03DE02 },
{ "US/Hawaii" , 0x03E56B },
{ "US/Indiana-Starke" , 0x03E5DC },
{ "US/Michigan" , 0x03E94D },
{ "US/Mountain" , 0x03EC84 },
{ "US/Pacific" , 0x03EFFD },
{ "US/Pacific-New" , 0x03F402 },
{ "US/Samoa" , 0x03F807 },
{ "UTC" , 0x03F890 },
{ "W-SU" , 0x03FB87 },
{ "WET" , 0x03F8D4 },
{ "Zulu" , 0x03FDC1 },
};
/* This is a generated file, do not modify */
const unsigned char timelib_timezone_db_data_builtin[261632] = {
const unsigned char timelib_timezone_db_data_builtin[261637] = {
/* Africa/Abidjan */
@@ -8126,7 +8126,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, 0xFB, 0x27, 0x42, 0x50, 0x08, 0x7C, 0x8B, 0xE0,
0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5E, 0x9E, 0xE0, 0x23, 0x20, 0x5D, 0x50, 0x24, 0x5A, 0x30, 0x60,
0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
@@ -8199,7 +8199,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, 0xFB, 0x27, 0x42, 0x50, 0x08, 0x7C, 0x8B, 0xE0,
0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5E, 0x9E, 0xE0, 0x23, 0x20, 0x5D, 0x50, 0x24, 0x5A, 0x30, 0x60,
0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
@@ -8375,7 +8375,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
0x4D, 0x8F, 0xDD, 0x90, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x38, 0xBE, 0x10, 0x54, 0x4C, 0x47, 0x90,
0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
@@ -8445,7 +8445,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5E, 0x9E, 0xE0, 0x23, 0x20, 0x5D, 0x50, 0x24, 0x5A, 0x30, 0x60,
0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
@@ -9314,7 +9314,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5E, 0x9E, 0xE0, 0x23, 0x20, 0x5D, 0x50, 0x24, 0x5A, 0x30, 0x60,
0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
@@ -13595,7 +13595,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
0x4D, 0x8F, 0xDD, 0x90, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x38, 0xBE, 0x10, 0x54, 0x4C, 0x47, 0x90,
0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
@@ -13756,54 +13756,54 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
/* Europe/Kiev */
0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA7, 0x64,
0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA7, 0x64,
0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xCD, 0x2E, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xCD, 0xA8, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40,
0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40,
0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0,
0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0,
0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0,
0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50,
0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50,
0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06,
0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00,
0x00, 0x1C, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00,
0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C,
0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00,
0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01,
0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D,
0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00,
0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD6, 0x48,
0xC5, 0x01, 0x41, 0x39, 0x12, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F,
0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73,
0x26, 0x0B, 0xFB, 0xF0, 0x26, 0x8D, 0x20, 0xE0, 0x28, 0xE5, 0x17, 0x80, 0x29, 0xD4, 0xEC, 0x60,
0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60,
0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03,
0x04, 0x03, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1C, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04,
0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20,
0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00,
0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19,
0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00,
0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54,
0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x00, 0xD6, 0x48, 0xC5, 0x01, 0x41, 0x39, 0x12, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F,
0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73,
/* Europe/Lisbon */
0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16255,7 +16255,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5E, 0x9E, 0xE0, 0x23, 0x20, 0x5D, 0x50, 0x24, 0x5A, 0x30, 0x60,
0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
@@ -17003,18 +17003,18 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60,
0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0,
0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0,
0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x6A, 0xE0,
0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60,
0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x2D, 0x60,
0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x2B, 0xE0,
0x61, 0x74, 0x15, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xEF, 0xE0,
0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xB3, 0xE0,
0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xB2, 0x60,
0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x76, 0x60,
0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x3A, 0x60,
0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0,
0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xFC, 0xE0,
0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xC0, 0xE0,
0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x5C, 0xD0,
0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x79, 0x50, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x5B, 0x50,
0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x3D, 0x50, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x1F, 0x50,
0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x01, 0x50, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x1D, 0xD0,
0x61, 0x74, 0x15, 0x60, 0x61, 0xEB, 0xFF, 0xD0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xE1, 0xD0,
0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xC3, 0xD0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xA5, 0xD0,
0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x87, 0xD0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xA4, 0x50,
0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x86, 0x50, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x68, 0x50,
0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x4A, 0x50, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x2C, 0x50,
0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x0E, 0x50, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x2A, 0xD0,
0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x0C, 0xD0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xEE, 0xD0,
0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xD0, 0xD0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xB2, 0xD0,
0x7F, 0x8D, 0xE4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
@@ -17617,7 +17617,7 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
0x4D, 0x8F, 0xDD, 0x90, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x38, 0xBE, 0x10, 0x54, 0x4C, 0x47, 0x90,
0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
@@ -18416,4 +18416,4 @@ const unsigned char timelib_timezone_db_data_builtin[261632] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
const timelib_tzdb timezonedb_builtin = { "2013.9", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
const timelib_tzdb timezonedb_builtin = { "2014.1", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+11 -12
View File
@@ -28,7 +28,7 @@ static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 24
static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
{
if (*a < start) {
*b -= (start - *a - 1) / adj + 1;
@@ -38,7 +38,6 @@ static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, t
*b += *a / adj;
*a -= adj * (*a / adj);
}
return 0;
}
static void inc_month(timelib_sll *y, timelib_sll *m)
@@ -170,24 +169,24 @@ static void do_adjust_for_weekday(timelib_time* time)
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
{
do {} while (do_range_limit(0, 60, 60, &rt->s, &rt->i));
do {} while (do_range_limit(0, 60, 60, &rt->i, &rt->h));
do {} while (do_range_limit(0, 24, 24, &rt->h, &rt->d));
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
do_range_limit(0, 60, 60, &rt->s, &rt->i);
do_range_limit(0, 60, 60, &rt->i, &rt->h);
do_range_limit(0, 24, 24, &rt->h, &rt->d);
do_range_limit(0, 12, 12, &rt->m, &rt->y);
do_range_limit_days_relative(&base->y, &base->m, &rt->y, &rt->m, &rt->d, rt->invert);
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
do_range_limit(0, 12, 12, &rt->m, &rt->y);
}
void timelib_do_normalize(timelib_time* time)
{
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->s, &time->i);
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->i, &time->h);
if (time->s != TIMELIB_UNSET) do_range_limit(0, 24, 24, &time->h, &time->d);
do_range_limit(1, 13, 12, &time->m, &time->y);
do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
do_range_limit(1, 13, 12, &time->m, &time->y);
}
static void do_adjust_relative(timelib_time* time)
+28
View File
@@ -214,6 +214,34 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
tm->have_zone = 1;
}
void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset)
{
if (t->tz_abbr) {
free(t->tz_abbr);
}
t->tz_abbr = NULL;
t->z = utc_offset;
t->have_zone = 1;
t->zone_type = TIMELIB_ZONETYPE_OFFSET;
t->dst = 0;
t->tz_info = NULL;
}
void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info)
{
if (t->tz_abbr) {
free(t->tz_abbr);
}
t->tz_abbr = strdup(abbr_info.abbr);
t->z = abbr_info.utc_offset;
t->have_zone = 1;
t->zone_type = TIMELIB_ZONETYPE_ABBR;
t->dst = abbr_info.dst;
t->tz_info = NULL;
}
void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz)
{
timelib_time_offset *gmt_offset;
+11 -4
View File
@@ -2992,11 +2992,18 @@ PHP_FUNCTION(date_timezone_set)
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC);
if (tzobj->type != TIMELIB_ZONETYPE_ID) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only do this for zones with ID for now");
return;
switch (tzobj->type) {
case TIMELIB_ZONETYPE_OFFSET:
timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset);
break;
case TIMELIB_ZONETYPE_ABBR:
timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z);
break;
case TIMELIB_ZONETYPE_ID:
timelib_set_timezone(dateobj->time, tzobj->tzi.tz);
break;
}
timelib_set_timezone(dateobj->time, tzobj->tzi.tz);
timelib_unixtime2local(dateobj->time, dateobj->time->sse);
RETURN_ZVAL(object, 1, 0);
+3 -8
View File
@@ -122,14 +122,9 @@ struct _php_timezone_obj {
int initialized;
int type;
union {
timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */
timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */
struct /* TIMELIB_ZONETYPE_ABBR */
{
timelib_sll utc_offset;
char *abbr;
int dst;
} z;
timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID */
timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */
timelib_abbr_info z; /* TIMELIB_ZONETYPE_ABBR */
} tzi;
};
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #44780 (some time zone offsets not recognized by timezone_name_from_abbr)
--FILE--
<?php
var_dump( timezone_name_from_abbr("", 5.5*3600, false) );
var_dump( timezone_name_from_abbr("", 28800, false) );
?>
--EXPECT--
string(12) "Asia/Kolkata"
string(13) "Asia/Shanghai"
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Test for bug #45543: DateTime::setTimezone can not set timezones without ID.
--INI--
date.timezone=UTC
--FILE--
<?php
$test_dates = array(
'2008-01-01 12:00:00 PDT',
'2008-01-01 12:00:00 +02:00',
);
foreach ($test_dates as $test_date)
{
$d1 = new DateTime($test_date);
$d2 = new DateTime('2008-01-01 12:00:00 UTC');
echo $d1->format(DATE_ISO8601), PHP_EOL;
echo $d2->format(DATE_ISO8601), PHP_EOL;
$tz = $d1->getTimeZone();
$d2->setTimeZone($tz);
echo $d1->format(DATE_ISO8601), PHP_EOL;
echo $d2->format(DATE_ISO8601), PHP_EOL;
echo PHP_EOL;
}
--EXPECT--
2008-01-01T12:00:00-0700
2008-01-01T12:00:00+0000
2008-01-01T12:00:00-0700
2008-01-01T05:00:00-0700
2008-01-01T12:00:00+0200
2008-01-01T12:00:00+0000
2008-01-01T12:00:00+0200
2008-01-01T14:00:00+0200
+21281 -21281
View File
File diff suppressed because it is too large. Load diff
+258 -61
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/apprentice.c 2013-04-27 13:53:32.175250261 +0200
--- libmagic.orig/apprentice.c Thu Mar 21 18:45:14 2013
+++ libmagic/apprentice.c Fri May 3 15:19:35 2013
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -830,8 +830,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2012-10-31 18:03:01.000000000 +0100
+++ libmagic/ascmagic.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012
+++ libmagic/ascmagic.c Tue Feb 18 18:44:17 2014
@@ -139,7 +139,7 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -841,6 +841,15 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
file_oomem(ms, mlen);
goto done;
}
@@ -147,7 +147,7 @@
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
- (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
+ (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
rv = -1;
}
@@ -211,6 +211,7 @@
case 0:
if (file_printf(ms, ", ") == -1)
@@ -860,8 +869,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/cdf.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013
+++ libmagic/cdf.c Sun Apr 7 22:30:22 2013
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -923,8 +932,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2012-10-31 18:03:01.000000000 +0100
+++ libmagic/cdf.h 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012
+++ libmagic/cdf.h Sun Apr 7 22:30:22 2013
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -966,8 +975,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2012-10-31 18:03:01.000000000 +0100
+++ libmagic/cdf_time.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012
+++ libmagic/cdf_time.c Sun Apr 7 22:30:22 2013
@@ -96,7 +96,7 @@
}
@@ -1026,8 +1035,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
static const char *ref = "Sat Apr 23 01:30:00 1977";
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2013-01-06 21:35:43.000000000 +0100
+++ libmagic/compress.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/compress.c Sun Jan 6 21:35:43 2013
+++ libmagic/compress.c Sun Apr 7 22:30:22 2013
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1189,8 +1198,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2013-02-18 16:40:59.000000000 +0100
+++ libmagic/file.h 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/file.h Mon Feb 18 16:40:59 2013
+++ libmagic/file.h Tue Feb 18 18:44:17 2014
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1303,7 +1312,13 @@ diff -u libmagic.orig/file.h libmagic/file.h
protected int file_zmagic(struct magic_set *, int, const char *,
const unsigned char *, size_t);
#endif
@@ -443,16 +442,13 @@
@@ -438,21 +437,18 @@
unichar **, size_t *, const char **, const char **, const char **);
protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
- int, int);
+ size_t, int, int);
protected int file_apprentice(struct magic_set *, const char *, int);
protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
protected uint64_t file_signextend(struct magic_set *, struct magic *,
uint64_t);
@@ -1377,22 +1392,24 @@ diff -u libmagic.orig/file.h libmagic/file.h
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
#define QUICK
@@ -533,4 +511,12 @@
#define FILE_RCSID(id)
@@ -531,6 +509,14 @@
#endif
#else
#define FILE_RCSID(id)
+#endif
+
+#ifdef PHP_WIN32
+#define FINFO_LSEEK_FUNC _lseek
+#define FINFO_READ_FUNC _read
+#else
+#define FINFO_LSEEK_FUNC lseek
+#define FINFO_READ_FUNC read
+#endif
+
#endif
#endif /* __file_h__ */
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/fsmagic.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/fsmagic.c Thu Mar 21 18:45:14 2013
+++ libmagic/fsmagic.c Sun Apr 7 22:30:22 2013
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1758,8 +1775,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
return ret;
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2012-10-31 18:03:01.000000000 +0100
+++ libmagic/funcs.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012
+++ libmagic/funcs.c Tue Feb 18 18:44:17 2014
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1896,7 +1913,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "zmagic %d\n", m);
goto done;
@@ -219,12 +221,17 @@
@@ -219,16 +221,21 @@
}
/* Check if we have a CDF file */
@@ -1919,6 +1936,11 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
- if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
+ if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
looks_text)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "softmagic %d\n", m);
@@ -296,7 +303,6 @@
return m;
@@ -2047,8 +2069,8 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
}
+
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2013-01-11 17:43:09.000000000 +0100
+++ libmagic/magic.c 2013-04-27 13:53:32.175250261 +0200
--- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013
+++ libmagic/magic.c Fri May 3 15:19:35 2013
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2391,8 +2413,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2013-03-21 18:52:42.000000000 +0100
+++ libmagic/magic.h 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/magic.h Thu Mar 21 18:52:42 2013
+++ libmagic/magic.h Sun Apr 7 22:30:22 2013
@@ -87,6 +87,7 @@
const char *magic_getpath(const char *, int);
@@ -2410,15 +2432,15 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/print.c 2013-04-27 13:53:32.175250261 +0200
@@ -28,13 +28,17 @@
/*
--- libmagic.orig/print.c Thu Mar 21 18:45:14 2013
+++ libmagic/print.c Mon Dec 16 23:09:24 2013
@@ -29,12 +29,17 @@
* print.c - debugging printout routines
*/
+#define _GNU_SOURCE
+#include "php.h"
+
#include "file.h"
+#include "cdf.h"
@@ -2430,7 +2452,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -43,188 +47,28 @@
@@ -43,188 +48,28 @@
#endif
#include <time.h>
@@ -2631,7 +2653,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
}
protected const char *
@@ -235,7 +79,7 @@
@@ -235,7 +80,7 @@
struct tm *tm;
if (flags & FILE_T_WINDOWS) {
@@ -2641,8 +2663,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
t = ts.tv_sec;
}
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2012-10-31 18:03:01.000000000 +0100
+++ libmagic/readcdf.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012
+++ libmagic/readcdf.c Sun Apr 7 22:30:22 2013
@@ -30,7 +30,11 @@
#endif
@@ -2704,8 +2726,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (file_printf(ms, "application/CDFV2-corrupt") == -1)
return -1;
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/readelf.c 2013-04-08 15:42:57.328298809 +0200
--- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013
+++ libmagic/readelf.c Sun Apr 7 22:30:22 2013
@@ -48,8 +48,8 @@
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
off_t, int *, int);
@@ -2956,8 +2978,8 @@ 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 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/readelf.h 2013-03-31 16:57:18.499744030 +0200
--- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013
+++ libmagic/readelf.h Wed Mar 28 15:35:26 2012
@@ -44,9 +44,17 @@
typedef uint32_t Elf32_Word;
typedef uint8_t Elf32_Char;
@@ -2977,8 +2999,8 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
typedef uint32_t Elf64_Word;
typedef uint8_t Elf64_Char;
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200
--- libmagic.orig/softmagic.c Thu Mar 21 18:45:14 2013
+++ libmagic/softmagic.c Mon Mar 10 14:03:18 2014
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@@ -2991,7 +3013,32 @@ 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 *,
@@ -132,7 +137,7 @@
@@ -62,6 +67,8 @@
private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
+#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
+
/*
* softmagic - lookup one file in parsed, in-memory copy of database
* Passed the name and FILE * of one file to be typed.
@@ -69,13 +76,13 @@
/*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */
protected int
file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
- int mode, int text)
+ size_t level, int mode, int text)
{
struct mlist *ml;
int rv, printed_something = 0, need_separator = 0;
for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next)
if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode,
- text, 0, 0, &printed_something, &need_separator,
+ text, 0, level, &printed_something, &need_separator,
NULL)) != 0)
return rv;
@@ -132,7 +139,7 @@
struct magic *m = &magic[magindex];
if (m->type != FILE_NAME)
@@ -3000,7 +3047,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
#define FLT (STRING_BINTEST | STRING_TEXTTEST)
((text && (m->str_flags & FLT) == STRING_BINTEST) ||
(!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
@@ -209,8 +214,8 @@
@@ -209,8 +216,8 @@
if (file_check_mem(ms, ++cont_level) == -1)
return -1;
@@ -3011,7 +3058,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
m = &magic[magindex];
ms->line = m->lineno; /* for messages */
@@ -335,44 +340,22 @@
@@ -335,44 +342,22 @@
private int
check_fmt(struct magic_set *ms, struct magic *m)
{
@@ -3066,7 +3113,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int32_t
mprint(struct magic_set *ms, struct magic *m)
{
@@ -583,13 +566,13 @@
@@ -583,13 +568,13 @@
char *cp;
int rval;
@@ -3082,7 +3129,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
if (rval == -1)
return -1;
@@ -835,16 +818,16 @@
@@ -835,16 +820,16 @@
if (m->num_mask) \
switch (m->mask_op & FILE_OPS_MASK) { \
case FILE_OPADD: \
@@ -3103,7 +3150,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
break; \
} \
@@ -1145,9 +1128,6 @@
@@ -1145,9 +1130,6 @@
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
nbytes, count);
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
@@ -3113,7 +3160,79 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
if (m->flag & INDIR) {
@@ -1644,9 +1624,6 @@
@@ -1191,7 +1173,7 @@
}
switch (cvt_flip(m->in_type, flip)) {
case FILE_BYTE:
- if (nbytes < (offset + 1))
+ if (OFFSET_OOB(nbytes, offset, 1))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1226,7 +1208,7 @@
offset = ~offset;
break;
case FILE_BESHORT:
- if (nbytes < (offset + 2))
+ if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1278,7 +1260,7 @@
offset = ~offset;
break;
case FILE_LESHORT:
- if (nbytes < (offset + 2))
+ if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1330,7 +1312,7 @@
offset = ~offset;
break;
case FILE_SHORT:
- if (nbytes < (offset + 2))
+ if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1367,7 +1349,7 @@
break;
case FILE_BELONG:
case FILE_BEID3:
- if (nbytes < (offset + 4))
+ if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1438,7 +1420,7 @@
break;
case FILE_LELONG:
case FILE_LEID3:
- if (nbytes < (offset + 4))
+ if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1508,7 +1490,7 @@
offset = ~offset;
break;
case FILE_MELONG:
- if (nbytes < (offset + 4))
+ if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1578,7 +1560,7 @@
offset = ~offset;
break;
case FILE_LONG:
- if (nbytes < (offset + 4))
+ if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1644,23 +1626,20 @@
if ((ms->flags & MAGIC_DEBUG) != 0) {
mdebug(offset, (char *)(void *)p,
sizeof(union VALUETYPE));
@@ -3123,23 +3242,101 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
@@ -1717,12 +1694,12 @@
ms->o.buf = sbuf;
/* Verify we have enough data to match magic type */
switch (m->type) {
case FILE_BYTE:
- if (nbytes < (offset + 1)) /* should alway be true */
+ if (OFFSET_OOB(nbytes, offset, 1))
return 0;
break;
case FILE_SHORT:
case FILE_BESHORT:
case FILE_LESHORT:
- if (nbytes < (offset + 2))
+ if (OFFSET_OOB(nbytes, offset, 2))
return 0;
break;
@@ -1679,38 +1658,40 @@
case FILE_FLOAT:
case FILE_BEFLOAT:
case FILE_LEFLOAT:
- if (nbytes < (offset + 4))
+ if (OFFSET_OOB(nbytes, offset, 4))
return 0;
break;
case FILE_DOUBLE:
case FILE_BEDOUBLE:
case FILE_LEDOUBLE:
- if (nbytes < (offset + 8))
+ if (OFFSET_OOB(nbytes, offset, 8))
return 0;
break;
case FILE_STRING:
case FILE_PSTRING:
case FILE_SEARCH:
- if (nbytes < (offset + m->vallen))
+ if (OFFSET_OOB(nbytes, offset, m->vallen))
return 0;
break;
case FILE_REGEX:
- if (nbytes < offset)
+ if (OFFSET_OOB(nbytes, offset, 0))
return 0;
break;
case FILE_INDIRECT:
- if (nbytes < offset)
+ if (offset == 0)
+ return 0;
+ if (OFFSET_OOB(nbytes, offset, 0))
return 0;
sbuf = ms->o.buf;
soffset = ms->offset;
ms->o.buf = NULL;
ms->offset = 0;
rv = file_softmagic(ms, s + offset, nbytes - offset,
- BINTEST, text);
+ recursion_level, BINTEST, text);
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
rbuf = ms->o.buf;
@@ -1718,16 +1699,26 @@
ms->offset = soffset;
if (rv == 1) {
- if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
+ if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
file_printf(ms, m->desc, offset) == -1)
- return -1;
+ return -1;
if (file_printf(ms, "%s", rbuf) == -1)
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
- file_printf(ms, m->desc, offset) == -1)
+ file_printf(ms, m->desc, offset) == -1) {
+ if (rbuf) {
+ efree(rbuf);
+ }
return -1;
- if (file_printf(ms, "%s", rbuf) == -1)
+ }
+ if (file_printf(ms, "%s", rbuf) == -1) {
+ if (rbuf) {
+ efree(rbuf);
+ }
return -1;
- free(rbuf);
+ }
+ }
+ if (rbuf) {
+ efree(rbuf);
}
return rv;
@@ -1837,6 +1814,42 @@
case FILE_USE:
- if (nbytes < offset)
+ if (OFFSET_OOB(nbytes, offset, 0))
return 0;
sbuf = m->value.s;
if (*sbuf == '^') {
@@ -1837,6 +1828,42 @@
return file_strncmp(a, b, len, flags);
}
@@ -3182,7 +3379,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
@@ -1996,69 +2009,157 @@
@@ -1996,69 +2023,157 @@
break;
}
case FILE_REGEX: {
+1 -1
View File
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
(size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
rv = -1;
}
+1 -1
View File
@@ -437,7 +437,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t,
unichar **, size_t *, const char **, const char **, const char **);
protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
int, int);
size_t, int, int);
protected int file_apprentice(struct magic_set *, const char *, int);
protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
protected uint64_t file_signextend(struct magic_set *, struct magic *,
+1 -1
View File
@@ -235,7 +235,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
looks_text)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "softmagic %d\n", m);
+37 -23
View File
@@ -67,6 +67,8 @@ private void cvt_16(union VALUETYPE *, const struct magic *);
private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
/*
* softmagic - lookup one file in parsed, in-memory copy of database
* Passed the name and FILE * of one file to be typed.
@@ -74,13 +76,13 @@ private void cvt_64(union VALUETYPE *, const struct magic *);
/*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */
protected int
file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
int mode, int text)
size_t level, int mode, int text)
{
struct mlist *ml;
int rv, printed_something = 0, need_separator = 0;
for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next)
if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode,
text, 0, 0, &printed_something, &need_separator,
text, 0, level, &printed_something, &need_separator,
NULL)) != 0)
return rv;
@@ -1171,7 +1173,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
}
switch (cvt_flip(m->in_type, flip)) {
case FILE_BYTE:
if (nbytes < (offset + 1))
if (OFFSET_OOB(nbytes, offset, 1))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1206,7 +1208,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ~offset;
break;
case FILE_BESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1258,7 +1260,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ~offset;
break;
case FILE_LESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1310,7 +1312,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ~offset;
break;
case FILE_SHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1347,7 +1349,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
break;
case FILE_BELONG:
case FILE_BEID3:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1418,7 +1420,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
break;
case FILE_LELONG:
case FILE_LEID3:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1488,7 +1490,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ~offset;
break;
case FILE_MELONG:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1558,7 +1560,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ~offset;
break;
case FILE_LONG:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
@@ -1630,14 +1632,14 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
/* Verify we have enough data to match magic type */
switch (m->type) {
case FILE_BYTE:
if (nbytes < (offset + 1)) /* should always be true */
if (OFFSET_OOB(nbytes, offset, 1))
return 0;
break;
case FILE_SHORT:
case FILE_BESHORT:
case FILE_LESHORT:
if (nbytes < (offset + 2))
if (OFFSET_OOB(nbytes, offset, 2))
return 0;
break;
@@ -1656,55 +1658,67 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_FLOAT:
case FILE_BEFLOAT:
case FILE_LEFLOAT:
if (nbytes < (offset + 4))
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
break;
case FILE_DOUBLE:
case FILE_BEDOUBLE:
case FILE_LEDOUBLE:
if (nbytes < (offset + 8))
if (OFFSET_OOB(nbytes, offset, 8))
return 0;
break;
case FILE_STRING:
case FILE_PSTRING:
case FILE_SEARCH:
if (nbytes < (offset + m->vallen))
if (OFFSET_OOB(nbytes, offset, m->vallen))
return 0;
break;
case FILE_REGEX:
if (nbytes < offset)
if (OFFSET_OOB(nbytes, offset, 0))
return 0;
break;
case FILE_INDIRECT:
if (nbytes < offset)
if (offset == 0)
return 0;
if (OFFSET_OOB(nbytes, offset, 0))
return 0;
sbuf = ms->o.buf;
soffset = ms->offset;
ms->o.buf = NULL;
ms->offset = 0;
rv = file_softmagic(ms, s + offset, nbytes - offset,
BINTEST, text);
recursion_level, BINTEST, text);
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
rbuf = ms->o.buf;
ms->o.buf = sbuf;
ms->offset = soffset;
if (rv == 1) {
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
file_printf(ms, m->desc, offset) == -1)
return -1;
if (file_printf(ms, "%s", rbuf) == -1)
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
file_printf(ms, m->desc, offset) == -1) {
if (rbuf) {
efree(rbuf);
}
return -1;
}
if (file_printf(ms, "%s", rbuf) == -1) {
if (rbuf) {
efree(rbuf);
}
return -1;
}
}
if (rbuf) {
efree(rbuf);
}
return rv;
case FILE_USE:
if (nbytes < offset)
if (OFFSET_OOB(nbytes, offset, 0))
return 0;
sbuf = m->value.s;
if (*sbuf == '^') {
+39
View File
@@ -0,0 +1,39 @@
Patches applied to file sources tree before generating magic.mgc
and before running create_data_file.php to create data_file.c.
From ef2329cf71acb59204dd981e2c6cce6c81fe467c Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Mon, 25 Mar 2013 14:06:55 +0000
Subject: [PATCH] limit to 100 repetitions to avoid excessive backtracking
Carsten Wolff
---
magic/Magdir/commands | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
index 67c3eee..4a7d8dd 100644
--- a/magic/Magdir/commands
+++ b/magic/Magdir/commands
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: commands,v 1.44 2013/02/05 15:20:47 christos Exp $
+# $File: commands,v 1.45 2013/02/06 14:18:52 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@@ -49,7 +49,7 @@
!:mime text/x-awk
0 string/wt #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
-0 regex =^\\s*BEGIN\\s*[{] awk script text
+0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
# AT&T Bell Labs' Plan 9 shell
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
--
1.8.5.5
+39
View File
@@ -0,0 +1,39 @@
--TEST--
Bug #66731: file: infinite recursion
--SKIPIF--
<?php
if (!class_exists('finfo'))
die('skip no fileinfo extension');
--FILE--
<?php
$fd = __DIR__.'/cve-2014-1943.data';
$fm = __DIR__.'/cve-2014-1943.magic';
$a = "\105\122\000\000\000\000\000";
$b = str_repeat("\001", 250000);
$m = "0 byte x\n".
">(1.b) indirect x\n";
file_put_contents($fd, $a);
$fi = finfo_open(FILEINFO_NONE);
var_dump(finfo_file($fi, $fd));
finfo_close($fi);
file_put_contents($fd, $b);
file_put_contents($fm, $m);
$fi = finfo_open(FILEINFO_NONE, $fm);
var_dump(finfo_file($fi, $fd));
finfo_close($fi);
?>
Done
--CLEAN--
<?php
@unlink(__DIR__.'/cve-2014-1943.data');
@unlink(__DIR__.'/cve-2014-1943.magic');
?>
--EXPECTF--
string(%d) "%s"
Warning: finfo_file(): Failed identify data 0:(null) in %s on line %d
bool(false)
Done
+2 -2
View File
@@ -4888,7 +4888,7 @@
>>0 ubyte 0xF5 FoxPro with memo
# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
#>>0 ubyte 0xFA FoxPro 2.x, with memo
# unkown version (should not happen)
# unknown version (should not happen)
>>0 default x xBase
>>>0 ubyte x (0x%x)
# flags in version byte
@@ -6115,7 +6115,7 @@
>>>>>379 string GRUB\ \0 \b, GRUB version 0.95 or 0.96
>>>>391 string Geom\0Hard\ Disk\0Read\0\ Error\0
>>>>>385 string GRUB\ \0 \b, GRUB version 0.97
#unkown version
#unknown version
>>>343 string Geom\0Read\0\ Error\0
>>>>321 string Loading\ stage1.5 \b, GRUB version x.y
>>>380 string Geom\0Hard\ Disk\0Read\0\ Error\0
+1
View File
@@ -1529,6 +1529,7 @@ ZEND_FUNCTION(gmp_testbit)
if (mpz_tstbit(*gmpnum_a, index)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
+1 -1
View File
@@ -38,7 +38,7 @@ static PHP_FUNCTION(json_last_error);
static const char digits[] = "0123456789abcdef";
zend_class_entry *php_json_serializable_ce;
PHP_JSON_API zend_class_entry *php_json_serializable_ce;
ZEND_DECLARE_MODULE_GLOBALS(json)
+1 -1
View File
@@ -50,7 +50,7 @@ ZEND_END_MODULE_GLOBALS(json)
PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long depth TSRMLS_DC);
extern zend_class_entry *php_json_serializable_ce;
extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
/* json_encode() options */
+365
View File
@@ -152,6 +152,15 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS);
/* Constants to be used with ldap_modify_batch() */
REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_ADD", LDAP_MODIFY_BATCH_ADD, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REMOVE", LDAP_MODIFY_BATCH_REMOVE, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REMOVE_ALL", LDAP_MODIFY_BATCH_REMOVE_ALL, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REPLACE", LDAP_MODIFY_BATCH_REPLACE, CONST_PERSISTENT | CONST_CS);
REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_ATTRIB", LDAP_MODIFY_BATCH_ATTRIB, CONST_PERSISTENT | CONST_CS);
REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_MODTYPE", LDAP_MODIFY_BATCH_MODTYPE, CONST_PERSISTENT | CONST_CS);
REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_VALUES", LDAP_MODIFY_BATCH_VALUES, CONST_PERSISTENT | CONST_CS);
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10
/* LDAP options */
REGISTER_LONG_CONSTANT("LDAP_OPT_DEREF", LDAP_OPT_DEREF, CONST_PERSISTENT | CONST_CS);
@@ -1432,6 +1441,355 @@ PHP_FUNCTION(ldap_delete)
}
/* }}} */
/* {{{ _ldap_str_equal_to_const
*/
static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *cstr)
{
int i;
if (strlen(cstr) != str_len)
return 0;
for (i = 0; i < str_len; ++i) {
if (str[i] != cstr[i]) {
return 0;
}
}
return 1;
}
/* }}} */
/* {{{ _ldap_strlen_max
*/
static int _ldap_strlen_max(const char *str, uint max_len)
{
int i;
for (i = 0; i < max_len; ++i) {
if (str[i] == '\0') {
return i;
}
}
return max_len;
}
/* }}} */
/* {{{ _ldap_hash_fetch
*/
static void _ldap_hash_fetch(zval *hashTbl, const char *key, zval **out)
{
zval **fetched;
if (zend_hash_find(Z_ARRVAL_P(hashTbl), key, strlen(key)+1, (void **) &fetched) == SUCCESS) {
*out = *fetched;
}
else {
*out = NULL;
}
}
/* }}} */
/* {{{ proto bool ldap_modify_batch(resource link, string dn, array modifs)
Perform multiple modifications as part of one operation */
PHP_FUNCTION(ldap_modify_batch)
{
ldap_linkdata *ld;
zval *link, *mods, *mod, *modinfo, *modval;
zval *attrib, *modtype, *vals;
zval **fetched;
char *dn;
int dn_len;
int i, j, k;
int num_mods, num_modprops, num_modvals;
LDAPMod **ldap_mods;
uint oper;
/*
$mods = array(
array(
"attrib" => "unicodePwd",
"modtype" => LDAP_MODIFY_BATCH_REMOVE,
"values" => array($oldpw)
),
array(
"attrib" => "unicodePwd",
"modtype" => LDAP_MODIFY_BATCH_ADD,
"values" => array($newpw)
),
array(
"attrib" => "userPrincipalName",
"modtype" => LDAP_MODIFY_BATCH_REPLACE,
"values" => array("janitor@corp.contoso.com")
),
array(
"attrib" => "userCert",
"modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL
)
);
*/
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
return;
}
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
/* perform validation */
{
char *modkey;
uint modkeylen;
long modtype;
/* to store the wrongly-typed keys */
ulong tmpUlong;
/* make sure the DN contains no NUL bytes */
if (_ldap_strlen_max(dn, dn_len) != dn_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN must not contain NUL bytes");
RETURN_FALSE;
}
/* make sure the top level is a normal array */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(mods));
if (zend_hash_get_current_key_type(Z_ARRVAL_P(mods)) != HASH_KEY_IS_LONG) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must not be string-indexed");
RETURN_FALSE;
}
num_mods = zend_hash_num_elements(Z_ARRVAL_P(mods));
for (i = 0; i < num_mods; i++) {
/* is the numbering consecutive? */
if (zend_hash_index_find(Z_ARRVAL_P(mods), i, (void **) &fetched) != SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
mod = *fetched;
/* is it an array? */
if (Z_TYPE_P(mod) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be an array itself");
RETURN_FALSE;
}
/* for the modification hashtable... */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(mod));
num_modprops = zend_hash_num_elements(Z_ARRVAL_P(mod));
for (j = 0; j < num_modprops; j++) {
/* are the keys strings? */
if (zend_hash_get_current_key_ex(Z_ARRVAL_P(mod), &modkey, &modkeylen, &tmpUlong, 0, NULL) != HASH_KEY_IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be string-indexed");
RETURN_FALSE;
}
/* modkeylen includes the terminating NUL byte; remove that */
--modkeylen;
/* is this a valid entry? */
if (
!_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_ATTRIB) &&
!_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_MODTYPE) &&
!_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_VALUES)
) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
RETURN_FALSE;
}
zend_hash_get_current_data(Z_ARRVAL_P(mod), (void **) &fetched);
modinfo = *fetched;
/* does the value type match the key? */
if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_ATTRIB)) {
if (Z_TYPE_P(modinfo) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
RETURN_FALSE;
}
if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
RETURN_FALSE;
}
}
else if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_MODTYPE)) {
if (Z_TYPE_P(modinfo) != IS_LONG) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
RETURN_FALSE;
}
/* is the value in range? */
modtype = Z_LVAL_P(modinfo);
if (
modtype != LDAP_MODIFY_BATCH_ADD &&
modtype != LDAP_MODIFY_BATCH_REMOVE &&
modtype != LDAP_MODIFY_BATCH_REPLACE &&
modtype != LDAP_MODIFY_BATCH_REMOVE_ALL
) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants");
RETURN_FALSE;
}
/* if it's REMOVE_ALL, there must not be a values array; otherwise, there must */
if (modtype == LDAP_MODIFY_BATCH_REMOVE_ALL) {
if (zend_hash_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES) + 1)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided");
RETURN_FALSE;
}
}
else {
if (!zend_hash_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES) + 1)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided");
RETURN_FALSE;
}
}
}
else if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_VALUES)) {
if (Z_TYPE_P(modinfo) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
RETURN_FALSE;
}
/* is the array not empty? */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo));
num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo));
if (num_modvals == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element");
RETURN_FALSE;
}
/* are its keys integers? */
if (zend_hash_get_current_key_type(Z_ARRVAL_P(modinfo)) != HASH_KEY_IS_LONG) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed");
RETURN_FALSE;
}
/* are the keys consecutive? */
for (k = 0; k < num_modvals; k++) {
if (zend_hash_index_find(Z_ARRVAL_P(modinfo), k, (void **) &fetched) != SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
modval = *fetched;
/* is the data element a string? */
if (Z_TYPE_P(modval) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string");
RETURN_FALSE;
}
}
}
zend_hash_move_forward(Z_ARRVAL_P(mod));
}
}
}
/* validation was successful */
/* allocate array of modifications */
ldap_mods = safe_emalloc((num_mods+1), sizeof(LDAPMod *), 0);
/* for each modification */
for (i = 0; i < num_mods; i++) {
/* allocate the modification struct */
ldap_mods[i] = safe_emalloc(1, sizeof(LDAPMod), 0);
/* fetch the relevant data */
zend_hash_index_find(Z_ARRVAL_P(mods), i, (void **) &fetched);
mod = *fetched;
_ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_ATTRIB, &attrib);
_ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_MODTYPE, &modtype);
_ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_VALUES, &vals);
/* map the modification type */
switch (Z_LVAL_P(modtype)) {
case LDAP_MODIFY_BATCH_ADD:
oper = LDAP_MOD_ADD;
break;
case LDAP_MODIFY_BATCH_REMOVE:
case LDAP_MODIFY_BATCH_REMOVE_ALL:
oper = LDAP_MOD_DELETE;
break;
case LDAP_MODIFY_BATCH_REPLACE:
oper = LDAP_MOD_REPLACE;
break;
default:
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown and uncaught modification type.");
RETURN_FALSE;
}
/* fill in the basic info */
ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES;
ldap_mods[i]->mod_type = estrndup(Z_STRVAL_P(attrib), Z_STRLEN_P(attrib));
if (Z_LVAL_P(modtype) == LDAP_MODIFY_BATCH_REMOVE_ALL) {
/* no values */
ldap_mods[i]->mod_bvalues = NULL;
}
else {
/* allocate space for the values as part of this modification */
num_modvals = zend_hash_num_elements(Z_ARRVAL_P(vals));
ldap_mods[i]->mod_bvalues = safe_emalloc((num_modvals+1), sizeof(struct berval *), 0);
/* for each value */
for (j = 0; j < num_modvals; j++) {
/* fetch it */
zend_hash_index_find(Z_ARRVAL_P(vals), j, (void **) &fetched);
modval = *fetched;
/* allocate the data struct */
ldap_mods[i]->mod_bvalues[j] = safe_emalloc(1, sizeof(struct berval), 0);
/* fill it */
ldap_mods[i]->mod_bvalues[j]->bv_len = Z_STRLEN_P(modval);
ldap_mods[i]->mod_bvalues[j]->bv_val = estrndup(Z_STRVAL_P(modval), Z_STRLEN_P(modval));
}
/* NULL-terminate values */
ldap_mods[i]->mod_bvalues[num_modvals] = NULL;
}
}
/* NULL-terminate modifications */
ldap_mods[num_mods] = NULL;
/* perform (finally) */
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
/* clean up */
{
for (i = 0; i < num_mods; i++) {
/* attribute */
efree(ldap_mods[i]->mod_type);
if (ldap_mods[i]->mod_bvalues != NULL) {
/* each BER value */
for (j = 0; ldap_mods[i]->mod_bvalues[j] != NULL; j++) {
/* free the data bytes */
efree(ldap_mods[i]->mod_bvalues[j]->bv_val);
/* free the bvalue struct */
efree(ldap_mods[i]->mod_bvalues[j]);
}
/* the BER value array */
efree(ldap_mods[i]->mod_bvalues);
}
/* the modification */
efree(ldap_mods[i]);
}
/* the modifications array */
efree(ldap_mods);
}
}
/* }}} */
/* {{{ proto int ldap_errno(resource link)
Get the current ldap error number */
PHP_FUNCTION(ldap_errno)
@@ -2516,6 +2874,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify, 0, 0, 3)
ZEND_ARG_INFO(0, entry)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify_batch, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_ARRAY_INFO(0, modifications_info, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_add, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
@@ -2669,6 +3033,7 @@ const zend_function_entry ldap_functions[] = {
PHP_FE(ldap_dn2ufn, arginfo_ldap_dn2ufn)
PHP_FE(ldap_add, arginfo_ldap_add)
PHP_FE(ldap_delete, arginfo_ldap_delete)
PHP_FE(ldap_modify_batch, arginfo_ldap_modify_batch)
PHP_FALIAS(ldap_modify, ldap_mod_replace, arginfo_ldap_modify)
/* additional functions for attribute based modifications, Gerrit Thomson */
+10
View File
@@ -50,4 +50,14 @@ ZEND_END_MODULE_GLOBALS(ldap)
#define phpext_ldap_ptr ldap_module_ptr
/* Constants for ldap_modify_batch */
#define LDAP_MODIFY_BATCH_ADD 0x01
#define LDAP_MODIFY_BATCH_REMOVE 0x02
#define LDAP_MODIFY_BATCH_REMOVE_ALL 0x12
#define LDAP_MODIFY_BATCH_REPLACE 0x03
#define LDAP_MODIFY_BATCH_ATTRIB "attrib"
#define LDAP_MODIFY_BATCH_MODTYPE "modtype"
#define LDAP_MODIFY_BATCH_VALUES "values"
#endif /* PHP_LDAP_H */
+109
View File
@@ -0,0 +1,109 @@
--TEST--
ldap_modify_batch() - Basic batch modify operation
--CREDITS--
Patrick Allaert <patrickallaert@php.net>
Ondřej Hošek <ondra.hosek@gmail.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifbindfailure.inc'); ?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
insert_dummy_data($link);
$mods = array(
array(
"attrib" => "telephoneNumber",
"modtype" => LDAP_MODIFY_BATCH_ADD,
"values" => array(
"+1 555 5551717"
)
),
array(
"attrib" => "sn",
"modtype" => LDAP_MODIFY_BATCH_REPLACE,
"values" => array("Brown-Smith")
),
array(
"attrib" => "description",
"modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL
)
);
var_dump(
ldap_modify_batch($link, "cn=userA,dc=my-domain,dc=com", $mods),
ldap_get_entries($link, ldap_search($link, "dc=my-domain,dc=com", "(sn=Brown-Smith)"))
);
?>
===DONE===
--CLEAN--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
remove_dummy_data($link);
?>
--EXPECT--
bool(true)
array(2) {
["count"]=>
int(1)
[0]=>
array(12) {
["objectclass"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(6) "person"
}
[0]=>
string(11) "objectclass"
["cn"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(5) "userA"
}
[1]=>
string(2) "cn"
["userpassword"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(4) "oops"
}
[2]=>
string(12) "userpassword"
["telephonenumber"]=>
array(3) {
["count"]=>
int(2)
[0]=>
string(14) "xx-xx-xx-xx-xx"
[1]=>
string(14) "+1 555 5551717"
}
[3]=>
string(15) "telephonenumber"
["sn"]=>
array(2) {
["count"]=>
int(1)
[0]=>
string(11) "Brown-Smith"
}
[4]=>
string(2) "sn"
["count"]=>
int(5)
["dn"]=>
string(28) "cn=userA,dc=my-domain,dc=com"
}
}
===DONE===
+104
View File
@@ -0,0 +1,104 @@
--TEST--
ldap_modify_batch() - Batch modify operations that should fail
--CREDITS--
Patrick Allaert <patrickallaert@php.net>
Ondřej Hošek <ondra.hosek@gmail.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifbindfailure.inc'); ?>
--FILE--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
$addGivenName = array(
array(
"attrib" => "givenName",
"modtype" => LDAP_MODIFY_BATCH_ADD,
"values" => array("Jack")
)
);
// Too few parameters
var_dump(ldap_modify_batch());
var_dump(ldap_modify_batch($link));
var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com"));
// Too many parameters
var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $addGivenName, "Invalid additional parameter"));
// DN not found
var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $addGivenName));
// Invalid DN
var_dump(ldap_modify_batch($link, "weirdAttribute=val", $addGivenName));
// prepare
$entry = array(
"objectClass" => array(
"top",
"dcObject",
"organization"),
"dc" => "my-domain",
"o" => "my-domain",
);
ldap_add($link, "dc=my-domain,dc=com", $entry);
// invalid domain
$mods = array(
array(
"attrib" => "dc",
"modtype" => LDAP_MODIFY_BATCH_REPLACE,
"values" => array("Wrong Domain")
)
);
var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $mods));
// invalid attribute
$mods = array(
array(
"attrib" => "weirdAttribute",
"modtype" => LDAP_MODIFY_BATCH_ADD,
"values" => array("weirdVal", "anotherWeirdval")
)
);
var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $mods));
?>
===DONE===
--CLEAN--
<?php
require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,dc=com");
?>
--EXPECTF--
Warning: ldap_modify_batch() expects exactly 3 parameters, 0 given in %s on line %d
NULL
Warning: ldap_modify_batch() expects exactly 3 parameters, 1 given in %s on line %d
NULL
Warning: ldap_modify_batch() expects exactly 3 parameters, 2 given in %s on line %d
NULL
Warning: ldap_modify_batch() expects exactly 3 parameters, 4 given in %s on line %d
NULL
Warning: ldap_modify_batch(): Batch Modify: No such object in %s on line %d
bool(false)
Warning: ldap_modify_batch(): Batch Modify: Invalid DN syntax in %s on line %d
bool(false)
Warning: ldap_modify_batch(): Batch Modify: Naming violation in %s on line %d
bool(false)
Warning: ldap_modify_batch(): Batch Modify: Undefined attribute type in %s on line %d
bool(false)
===DONE===
+4 -3
View File
@@ -1,6 +1,7 @@
--TEST--
zend multibyte (2)
--SKIPIF--
--XFAIL--
https://bugs.php.net/bug.php?id=66582
--INI--
zend.multibyte=On
zend.script_encoding=UTF-8
@@ -9,5 +10,5 @@ mbstring.internal_encoding=CP932
<?php
var_dump(bin2hex("テスト"));
?>
--EXPECT--
string(12) "836583588367"
--EXPECTF--
php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed.
+4 -3
View File
@@ -1,6 +1,7 @@
--TEST--
zend multibyte (6)
--SKIPIF--
--XFAIL--
https://bugs.php.net/bug.php?id=66582
--INI--
zend.multibyte=On
zend.script_encoding=EUC-JP
@@ -10,5 +11,5 @@ mbstring.internal_encoding=CP932
declare(encoding="UTF-8");
var_dump(bin2hex("テスト"));
?>
--EXPECT--
string(12) "836583588367"
--EXPECTF--
php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed.
@@ -1,6 +1,8 @@
--TEST--
zend multibyte (7)
--SKIPIF--
--XFAIL--
https://bugs.php.net/bug.php?id=66582
--INI--
zend.multibyte=On
zend.script_encoding=ISO-8859-1
@@ -1,6 +1,8 @@
--TEST--
zend multibyte (9)
--SKIPIF--
--XFAIL--
https://bugs.php.net/bug.php?id=66582
--INI--
zend.multibyte=On
zend.script_encoding=cp1251
@@ -1,6 +1,8 @@
--TEST--
zend multibyte (10)
--SKIPIF--
--INI--
zend.multibyte=1
--FILE--
<?php
declare(encoding="ISO-8859-15");
@@ -1,6 +1,8 @@
--TEST--
zend multibyte (11)
--SKIPIF--
--INI--
zend.multibyte=1
--FILE--
<?php
declare(encoding="ISO-8859-15") {
@@ -1,6 +1,8 @@
--TEST--
zend multibyte (12)
--SKIPIF--
--INI--
zend.multibyte=1
--FILE--
<?php
declare(encoding="ISO-8859-15");
+8 -1
View File
@@ -176,8 +176,11 @@ void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
php_free_stmt_bind_buffer(stmt->param, FETCH_SIMPLE);
/* Clean output bind */
php_free_stmt_bind_buffer(stmt->result, FETCH_RESULT);
#endif
if (stmt->link_handle) {
zend_objects_store_del_ref_by_handle(stmt->link_handle TSRMLS_CC);
}
#endif
if (stmt->query) {
efree(stmt->query);
}
@@ -1055,6 +1058,10 @@ PHP_FUNCTION(mysqli_stmt_construct)
efree(stmt);
RETURN_FALSE;
}
#ifndef MYSQLI_USE_MYSQLND
stmt->link_handle = Z_OBJ_HANDLE(*mysql_link);
zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC);
#endif
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)stmt;
+8
View File
@@ -1840,6 +1840,10 @@ PHP_FUNCTION(mysqli_prepare)
efree(stmt);
RETURN_FALSE;
}
#ifndef MYSQLI_USE_MYSQLND
stmt->link_handle = Z_OBJ_HANDLE(*mysql_link);
zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC);
#endif
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)stmt;
@@ -2368,6 +2372,10 @@ PHP_FUNCTION(mysqli_stmt_init)
efree(stmt);
RETURN_FALSE;
}
#ifndef MYSQLI_USE_MYSQLND
stmt->link_handle = Z_OBJ_HANDLE(*mysql_link);
zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC);
#endif
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
+4
View File
@@ -116,6 +116,10 @@ typedef struct {
BIND_BUFFER param;
BIND_BUFFER result;
char *query;
#ifndef MYSQLI_USE_MYSQLND
/* used to manage refcount with libmysql (already implement in mysqlnd) */
zend_object_handle link_handle;
#endif
} MY_STMT;
typedef struct {
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #66762 mysqli@libmysql segfault in mysqli_stmt::bind_result() when link closed
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once("connect.inc");
$mysqli = new mysqli($host, $user, $passwd, $db);
$read_stmt = $mysqli->prepare("SELECT 1");
var_dump($read_stmt->bind_result($data));
unset($mysqli);
var_dump($read_stmt->bind_result($data));
?>
done!
--EXPECT--
bool(true)
bool(true)
done!
+6
View File
@@ -544,6 +544,10 @@ enum mysqlnd_packet_type
};
/*
After adding new elements please update
`mysqlnd_command_to_text` in mysqlnd_wireprotocol.c
*/
enum php_mysqlnd_server_command
{
COM_SLEEP = 0,
@@ -576,6 +580,8 @@ enum php_mysqlnd_server_command
COM_SET_OPTION = 27,
COM_STMT_FETCH = 28,
COM_DAEMON,
COM_BINLOG_DUMP_GTID,
COM_RESET_CONNECTION,
COM_END
};
+2 -1
View File
@@ -90,7 +90,8 @@ const char * const mysqlnd_command_to_text[COM_END] =
"TIME", "DELAYED_INSERT", "CHANGE_USER", "BINLOG_DUMP",
"TABLE_DUMP", "CONNECT_OUT", "REGISTER_SLAVE",
"STMT_PREPARE", "STMT_EXECUTE", "STMT_SEND_LONG_DATA", "STMT_CLOSE",
"STMT_RESET", "SET_OPTION", "STMT_FETCH", "DAEMON"
"STMT_RESET", "SET_OPTION", "STMT_FETCH", "DAEMON", "BINLOG_DUMP_GTID",
"RESET_CONNECTION"
};
/* }}} */
+1 -1
View File
@@ -191,7 +191,7 @@ typedef struct { /* php_oci_statement {{{ */
sword errcode; /* last errcode*/
OCIError *err; /* private error handle */
OCIStmt *stmt; /* statement handle */
char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor recieved from Oracle */
char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */
long last_query_len; /* last query length */
HashTable *columns; /* hash containing all the result columns */
HashTable *binds; /* binds hash */
+13 -1
View File
@@ -3,9 +3,21 @@ DRCP: Test setting connection class inline
--SKIPIF--
<?php
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
require(dirname(__FILE__)."/details.inc");
require(dirname(__FILE__).'/connect.inc');
if (!$test_drcp) die("skip testing DRCP connection class only works in DRCP mode");
if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv);
// This test in Oracle 12c needs a non-CDB or the root container
if (isset($matches_sv[0]) && $matches_sv[1] >= 12) {
$s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual");
$r = @oci_execute($s);
if (!$r)
die('skip could not identify container type');
$r = oci_fetch_array($s);
if ($r['DBTYPE'] !== 'CDB$ROOT')
die('skip cannot run test using a PDB');
}
?>
--FILE--
<?php
+1 -1
View File
@@ -48,7 +48,7 @@ Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %s on line
Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %s on line %d
Warning: oci_execute(): ORA-00932: %s NUMBER %s BLOB in %s on line %d
Warning: oci_execute(): ORA-00932: %s on line %d
object(OCI-Lob)#%d (1) {
["descriptor"]=>
resource(%d) of type (oci8 descriptor)
Regular → Executable
+18 -5
View File
@@ -78,6 +78,10 @@
#endif
#define DEBUG_SMIME 0
#if !defined(OPENSSL_NO_EC) && defined(EVP_PKEY_EC)
#define HAVE_EVP_PKEY_EC 1
#endif
/* FIXME: Use the openssl constants instead of
* enum. It is now impossible to match real values
* against php constants. Also sorry to break the
@@ -88,7 +92,7 @@ enum php_openssl_key_type {
OPENSSL_KEYTYPE_DSA,
OPENSSL_KEYTYPE_DH,
OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA,
#ifdef EVP_PKEY_EC
#ifdef HAVE_EVP_PKEY_EC
OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1
#endif
};
@@ -854,7 +858,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
req->digest = req->md_alg = EVP_get_digestbyname(req->digest_name);
}
if (req->md_alg == NULL) {
req->md_alg = req->digest = EVP_md5();
req->md_alg = req->digest = EVP_sha1();
}
PHP_SSL_CONFIG_SYNTAX_CHECK(extensions_section);
@@ -1116,7 +1120,7 @@ PHP_MINIT_FUNCTION(openssl)
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DSA", OPENSSL_KEYTYPE_DSA, CONST_CS|CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DH", OPENSSL_KEYTYPE_DH, CONST_CS|CONST_PERSISTENT);
#ifdef EVP_PKEY_EC
#ifdef HAVE_EVP_PKEY_EC
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_EC", OPENSSL_KEYTYPE_EC, CONST_CS|CONST_PERSISTENT);
#endif
@@ -3013,6 +3017,15 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
return 0;
}
break;
#endif
#ifdef HAVE_EVP_PKEY_EC
case EVP_PKEY_EC:
assert(pkey->pkey.ec != NULL);
if ( NULL == EC_KEY_get0_private_key(pkey->pkey.ec)) {
return 0;
}
break;
#endif
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
@@ -3414,7 +3427,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
}
break;
#ifdef EVP_PKEY_EC
#ifdef HAVE_EVP_PKEY_EC
case EVP_PKEY_EC:
ktype = OPENSSL_KEYTYPE_EC;
break;
@@ -5001,7 +5014,7 @@ PHP_FUNCTION(openssl_cipher_iv_length)
/* {{{ proto string openssl_dh_compute_key(string pub_key, resource dh_key)
Computes shared sicret for public value of remote DH key and local DH key */
Computes shared secret for public value of remote DH key and local DH key */
PHP_FUNCTION(openssl_dh_compute_key)
{
zval *key;
+1
View File
@@ -3,6 +3,7 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
?>
--FILE--
<?php
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #66501: EC private key support in openssl_sign
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
--FILE--
<?php
$pkey = 'ASN1 OID: prime256v1
-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILPkqoeyM7XgwYkuSj3077lrsrfWJK5LqMolv+m2oOjZoAoGCCqGSM49
AwEHoUQDQgAEPq4hbIWHvB51rdWr8ejrjWo4qVNWVugYFtPg/xLQw0mHkIPZ4DvK
sqOTOnMoezkbSmVVMuwz9flvnqHGmQvmug==
-----END EC PRIVATE KEY-----';
$key = openssl_pkey_get_private($pkey);
$res = openssl_sign($data ='alpha', $sign, $key, 'ecdsa-with-SHA1');
var_dump($res);
--EXPECTF--
bool(true)
+2 -2
View File
@@ -196,7 +196,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) /* {{{
}
/* }}} */
/* {{{ proto void PDO::__construct(string dsn, string username, string passwd [, array options])
/* {{{ proto void PDO::__construct(string dsn[, string username[, string passwd [, array options]]])
*/
static PHP_METHOD(PDO, dbh_constructor)
{
@@ -1226,7 +1226,7 @@ static PHP_METHOD(PDO, getAvailableDrivers)
/* }}} */
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 3)
ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 1)
ZEND_ARG_INFO(0, dsn)
ZEND_ARG_INFO(0, username)
ZEND_ARG_INFO(0, passwd)
+6 -1
View File
@@ -64,7 +64,12 @@ static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC)
if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) {
pdo_dbh_t * dbh = zend_object_store_get_object(zv TSRMLS_CC);
if (!dbh || dbh->driver != &pdo_mysql_driver) {
if (!dbh) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to retrieve handle from object store");
return NULL;
}
if (dbh->driver != &pdo_mysql_driver) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name);
return NULL;
}
+2 -2
View File
@@ -30,7 +30,7 @@ $testQuery = 'SELECT 1 as verification';
// Create temp user with space in password
$sql = sprintf($template, 'my password');
$pdo->query($sql);
$testConn = new PDO($_ENV['PDOTEST_DSN'], $user, "my password");
$testConn = new PDO($conf['ENV']['PDOTEST_DSN'], $user, "my password");
$result = $testConn->query($testQuery)->fetch();
$check = $result[0];
var_dump($check);
@@ -42,7 +42,7 @@ $pdo->query($dropUser);
$sql = sprintf($template, "my pass''word");
$pdo->query($sql);
$testConn = new PDO($_ENV['PDOTEST_DSN'], $user, "my pass'word");
$testConn = new PDO($conf['ENV']['PDOTEST_DSN'], $user, "my pass'word");
$result = $testConn->query($testQuery)->fetch();
$check = $result[0];
var_dump($check);
+297 -319
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -16,7 +16,7 @@
| Jouni Ahto <jouni.ahto@exdec.fi> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_PGSQL_H
@@ -257,7 +257,7 @@ typedef enum _php_pgsql_data_type {
PG_PATH,
PG_POLYGON,
PG_CIRCLE,
/* unkown and system */
/* unknown and system */
PG_UNKNOWN
} php_pgsql_data_type;
@@ -56,6 +56,6 @@ string(13) "default value"
Fatal error: Uncaught exception 'ReflectionException' with message 'Class A does not have a property named ' in %sReflectionClass_getStaticPropertyValue_001_2_4.php:%d
Stack trace:
#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('?A?privateOverr...')
#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...')
#1 {main}
thrown in %sReflectionClass_getStaticPropertyValue_001_2_4.php on line %d
@@ -56,6 +56,6 @@ Set static values in A:
Fatal error: Uncaught exception 'ReflectionException' with message 'Class A does not have a property named ' in %sReflectionClass_setStaticPropertyValue_001_2_4.php:%d
Stack trace:
#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('?A?privateOverr...', 'new value 1')
#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1')
#1 {main}
thrown in %sReflectionClass_setStaticPropertyValue_001_2_4.php on line %d
+2
View File
@@ -176,10 +176,12 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
if (fstat(data->fd, &sbuf)) {
close(data->fd);
data->fd = -1;
return;
}
if (S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
close(data->fd);
data->fd = -1;
return;
}
}
+44 -2
View File
@@ -1183,6 +1183,49 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
#define COOKIE_SECURE "; secure"
#define COOKIE_HTTPONLY "; HttpOnly"
/*
* Remove already sent session ID cookie.
* It must be directly removed from SG(sapi_header) because sapi_add_header_ex()
* removes all of matching cookie. i.e. It deletes all of Set-Cookie headers.
*/
static void php_session_remove_cookie(TSRMLS_D) {
sapi_header_struct *header;
zend_llist *l = &SG(sapi_headers).headers;
zend_llist_element *next;
zend_llist_element *current;
char *session_cookie, *e_session_name;
int session_cookie_len, len = sizeof("Set-Cookie")-1;
e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL);
spprintf(&session_cookie, 0, "Set-Cookie: %s=", e_session_name);
efree(e_session_name);
session_cookie_len = strlen(session_cookie);
current = l->head;
while (current) {
header = (sapi_header_struct *)(current->data);
next = current->next;
if (header->header_len > len && header->header[len] == ':'
&& !strncmp(header->header, session_cookie, session_cookie_len)) {
if (current->prev) {
current->prev->next = next;
} else {
l->head = next;
}
if (next) {
next->prev = current->prev;
} else {
l->tail = current->prev;
}
sapi_free_header(header);
efree(current);
--l->count;
}
current = next;
}
efree(session_cookie);
}
static void php_session_send_cookie(TSRMLS_D) /* {{{ */
{
smart_str ncookie = {0};
@@ -1248,8 +1291,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
smart_str_0(&ncookie);
/* 'replace' must be 0 here, else a previous Set-Cookie
header, probably sent with setcookie() will be replaced! */
php_session_remove_cookie(TSRMLS_C); /* remove already sent session ID cookie */
sapi_add_header_ex(ncookie.c, ncookie.len, 0, 0 TSRMLS_CC);
}
/* }}} */
+2 -2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
--XFAIL--
Long term low priority bug, working on it
--INI--
session.save_path=
session.name=PHPSESSID
@@ -44,3 +42,5 @@ echo "um, hi\n";
?>
--EXPECTF--
write: goodbye cruel world
close: goodbye cruel world
+1 -2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write during exec
--XFAIL--
Long term low priority bug, working on it
--INI--
session.save_path=
session.name=PHPSESSID
@@ -47,3 +45,4 @@ echo "um, hi\n";
write: goodbye cruel world
Fatal error: Call to undefined function undefined_function() in %s on line %d
close: goodbye cruel world
+5 -2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec
--XFAIL--
Long term low priority bug, working on it
--INI--
session.save_path=
session.name=PHPSESSID
@@ -47,3 +45,8 @@ echo "um, hi\n";
write: goodbye cruel world
Fatal error: Uncaught exception 'Exception' in %s
Stack trace:
#0 [internal function]: write('%s', '')
#1 %s(%d): session_write_close()
#2 {main}
thrown in %s on line %d
+1 -2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec
--XFAIL--
Long term low priority bug, working on it
--INI--
session.save_path=
session.name=PHPSESSID
@@ -46,3 +44,4 @@ session_start();
write: goodbye cruel world
Fatal error: Call to undefined function undefined_function() in %s on line %d
close: goodbye cruel world
+6 -2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec
--XFAIL--
Long term low priority bug, working on it
--INI--
session.save_path=
session.name=PHPSESSID
@@ -46,3 +44,9 @@ session_start();
write: goodbye cruel world
Fatal error: Uncaught exception 'Exception' in %s
Stack trace:
#0 [internal function]: write('%s', '')
#1 {main}
thrown in %s on line %d
close: goodbye cruel world
-1
View File
@@ -14,4 +14,3 @@ var_dump(session_name("bar"));
Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0
string(9) "PHPSESSID"
string(3) "foo"
PHP Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0
+1 -1
View File
@@ -7,7 +7,7 @@ $dir->isFile();
--EXPECTF--
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Failed to open directory ""' in %s:%d
Stack trace:
#0 %s(%d): DirectoryIterator->__construct('?/abc')
#0 %s(%d): DirectoryIterator->__construct('\x00/abc')
#1 {main}
thrown in %s on line %d
+1 -1
View File
@@ -334,7 +334,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw,
#endif
default:
/* unkown type */
/* unknown type */
zval_ptr_dtor(subarray);
*subarray = NULL;
return;
+2 -2
View File
@@ -1395,8 +1395,8 @@ static const entity_multicodepoint_row multi_cp_html5_02ACC[] = {
{ {0x0FE00, "varsupsetneqq", 13} },
};
static const entity_multicodepoint_row multi_cp_html5_02AFD[] = {
{ {01, NULL , 0} },
{ {0x0FE00, "varsupsetneqq", 13} },
{ {01, "parsl", 5} },
{ {0x020E5, "nparsl", 6} },
};
/* End of double code point tables }}} */
@@ -461,6 +461,7 @@ if (empty($multicp_rows))
ksort($multicp_rows);
foreach ($multicp_rows as &$v) { ksort($v); }
unset($v);
echo
"/* {{{ Start of double code point tables for $name */", "\n\n";
+1 -1
View File
@@ -276,7 +276,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (headers != NULL) {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers);
} else {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(TSRMLS_C), f);
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f);
}
efree(f);
}
+31 -10
View File
@@ -112,8 +112,17 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS;
zend_hash_move_forward_ex(target_hash, &pos)) {
convert_to_string_ex(element);
el_len = Z_STRLEN_PP(element);
if (Z_TYPE_PP(element) != IS_STRING) {
zval tmp;
MAKE_COPY_ZVAL(element, &tmp);
convert_to_string(&tmp);
el_len = Z_STRLEN(tmp);
zval_dtor(&tmp);
} else {
el_len = Z_STRLEN_PP(element);
}
if (el_len == 0) {
continue;
}
@@ -125,7 +134,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
if (string_length == 0) {
continue;
}
sizeenv += string_length+1;
sizeenv += string_length;
break;
}
}
@@ -138,19 +147,26 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
for (zend_hash_internal_pointer_reset_ex(target_hash, &pos);
zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS;
zend_hash_move_forward_ex(target_hash, &pos)) {
zval tmp;
convert_to_string_ex(element);
el_len = Z_STRLEN_PP(element);
if (el_len == 0) {
continue;
if (Z_TYPE_PP(element) != IS_STRING) {
MAKE_COPY_ZVAL(element, &tmp);
convert_to_string(&tmp);
} else {
tmp = **element;
}
data = Z_STRVAL_PP(element);
el_len = Z_STRLEN(tmp);
if (el_len == 0) {
goto next_element;
}
data = Z_STRVAL(tmp);
switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, &pos)) {
case HASH_KEY_IS_STRING:
if (string_length == 0) {
continue;
goto next_element;
}
l = string_length + el_len + 1;
@@ -175,6 +191,11 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
case HASH_KEY_NON_EXISTANT:
break;
}
next_element:
if (Z_TYPE_PP(element) != IS_STRING) {
zval_dtor(&tmp);
}
}
assert((uint)(p - env.envp) <= sizeenv);
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #66535: Extra newline if add_x_header and no additional headers are used
--INI--
sendmail_path=tee mailBasic.out >/dev/null
mail.add_x_header = On
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
die("skip Won't run on Windows");
?>
--FILE--
<?php
/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
* Description: Send an email message
* Source code: ext/standard/mail.c
* Alias to functions:
*/
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
$to = 'user@company.com';
$subject = 'Test Subject';
$message = 'A Message';
$outFile = "mailBasic.out";
@unlink($outFile);
var_dump( mail($to, $subject, $message) );
echo file_get_contents($outFile);
unlink($outFile);
?>
===DONE===
--EXPECTF--
*** Testing mail() : send email without additional headers ***
bool(true)
To: user@company.com
Subject: Test Subject
X-PHP-Originating-Script: %d:bug66535.php
A Message
===DONE===
@@ -1,5 +1,7 @@
--TEST--
Test tan function : 64bit long tests
--INI--
precision=5
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
@@ -28,33 +30,34 @@ foreach ($longVals as $longVal) {
===DONE===
--EXPECT--
--- testing: 9223372036854775807 ---
float(84.739312968756)
float(84.739)
--- testing: -9223372036854775808 ---
float(-84.739312968756)
float(-84.739)
--- testing: 2147483647 ---
float(1.0523779637351)
float(1.0524)
--- testing: -2147483648 ---
float(4.0842894552986)
float(4.0843)
--- testing: 9223372034707292160 ---
float(-0.25738520049439)
float(-0.25739)
--- testing: -9223372034707292160 ---
float(0.25738520049439)
float(0.25739)
--- testing: 2147483648 ---
float(-4.0842894552986)
float(-4.0843)
--- testing: -2147483649 ---
float(0.34328416030117)
float(0.34328)
--- testing: 4294967294 ---
float(-19.579238091943)
float(-19.579)
--- testing: 4294967295 ---
float(-0.57225137018055)
float(-0.57225)
--- testing: 4294967293 ---
float(0.71667000824652)
float(0.71667)
--- testing: 9223372036854775806 ---
float(84.739312968756)
--- testing: 9.2233720368548E+18 ---
float(84.739312968756)
float(84.739)
--- testing: 9.2234E+18 ---
float(84.739)
--- testing: -9223372036854775807 ---
float(-84.739312968756)
--- testing: -9.2233720368548E+18 ---
float(-84.739312968756)
float(-84.739)
--- testing: -9.2234E+18 ---
float(-84.739)
===DONE===
+57
View File
@@ -0,0 +1,57 @@
--TEST--
Bug #60602 proc_open() modifies environment if it contains arrays
--FILE--
<?php
$descs = array(
0 => array('pipe', 'r'), // stdin
1 => array('pipe', 'w'), // stdout
2 => array('pipe', 'w'), // strerr
);
$environment = array('test' => array(1, 2, 3));
$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls';
$p = proc_open($cmd, $descs, $pipes, '.', $environment);
if (is_resource($p)) {
$data = '';
while (1) {
$w = $e = NULL;
$n = stream_select($pipes, $w, $e, 300);
if ($n === false) {
echo "no streams \n";
break;
} else if ($n === 0) {
echo "process timed out\n";
proc_terminate($p, 9);
break;
} else if ($n > 0) {
$line = fread($pipes[1], 8192);
if (strlen($line) == 0) {
/* EOF */
break;
}
$data .= $line;
}
}
var_dump(strlen($data));
$ret = proc_close($p);
var_dump($ret);
var_dump(is_array($environment['test']));
} else {
echo "no process\n";
}
?>
==DONE==
--EXPECTF--
Notice: Array to string conversion in %s on line %d
Notice: Array to string conversion in %s on line %d
int(%d)
int(0)
bool(true)
==DONE==
@@ -46,7 +46,7 @@ echo "Done\n";
--EXPECT--
*** Testing get_html_translation_table() : basic functionality/HTML 5 ***
-- with table = HTML_ENTITIES, ENT_COMPAT --
int(1509)
int(1510)
Array
(
[Æ] => &AElig;
@@ -1108,6 +1108,7 @@ Array
[⋾] => &notnivb;
[⋽] => &notnivc;
[∦] => &nparallel;
[⫽⃥] => &nparsl
[∂̸] => &npart
[⨔] => &npolint;
[⊀] => &npr;
@@ -1196,6 +1197,7 @@ Array
[⌽] => &ovbar;
[¶] => &para;
[⫳] => &parsim;
[⫽] => &parsl;
[∂] => &part;
[п] => &pcy;
[%] => &percnt;
@@ -1500,7 +1502,6 @@ Array
[⦜] => &vangrt;
[ϰ] => &varkappa;
[⫌︀] => &varsupsetneqq
[⫽︀] => &varsupsetneqq
[⊲] => &vartriangleleft;
[в] => &vcy;
[⊢] => &vdash;
@@ -1561,9 +1562,9 @@ Array
[‌] => &zwnj;
)
-- with table = HTML_ENTITIES, ENT_QUOTES --
int(1510)
int(1511)
-- with table = HTML_ENTITIES, ENT_NOQUOTES --
int(1508)
int(1509)
-- with table = HTML_SPECIALCHARS, ENT_COMPAT --
int(4)
Array
@@ -1418,6 +1418,7 @@ foreach ($mpcent as $i) {
&topcir; U+02AF1
&nhpar; U+02AF2
&parsim; U+02AF3
&parsl; U+02AFD
&fflig; U+0FB00
&filig; U+0FB01
&fllig; U+0FB02
@@ -1620,4 +1621,4 @@ foreach ($mpcent as $i) {
&nsupseteqq; U+02AC6 U+00338
&vsubnE; U+02ACB U+0FE00
&varsupsetneqq; U+02ACC U+0FE00
&varsupsetneqq; U+02AFD U+0FE00
&parsl;︀ U+02AFD U+0FE00
+2 -2
View File
@@ -266,8 +266,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
p = s;
} else {
/* memrchr is a GNU specific extension
Emulate for wide compatibility */
for(p = e; *p != ':' && p >= s; p--);
Emulate for wide compatability */
for(p = e; p >= s && *p != ':'; p--);
}
if (p >= s && *p == ':') {
@@ -26,7 +26,7 @@ struct myStruct {
?>';
var_dump( token_get_all($source));
// with invalid open tag for testing entire source to be unkown token
// with invalid open tag for testing entire source to be unknown token
echo "-- with invlalid PHP open tag & valid tokens --\n";
$source = '<pli
echo "hello world"; ?>';
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 4
#define PHP_RELEASE_VERSION 25
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "5.4.25-dev"
#define PHP_VERSION_ID 50425
#define PHP_RELEASE_VERSION 27
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "5.4.27"
#define PHP_VERSION_ID 50427
-35
View File
@@ -138,16 +138,6 @@
; Development Value: "GP"
; Production Value: "GP"
; session.bug_compat_42
; Default Value: On
; Development Value: On
; Production Value: Off
; session.bug_compat_warn
; Default Value: On
; Development Value: On
; Production Value: Off
; session.gc_divisor
; Default Value: 100
; Development Value: 1000
@@ -1476,31 +1466,6 @@ session.gc_maxlifetime = 1440
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; find /path/to/sessions -cmin +24 -type f | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope.
; PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It's
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won't be warned when it's
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-42
session.bug_compat_42 = On
; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-warn
session.bug_compat_warn = On
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
-35
View File
@@ -138,16 +138,6 @@
; Development Value: "GP"
; Production Value: "GP"
; session.bug_compat_42
; Default Value: On
; Development Value: On
; Production Value: Off
; session.bug_compat_warn
; Default Value: On
; Development Value: On
; Production Value: Off
; session.gc_divisor
; Default Value: 100
; Development Value: 1000
@@ -1476,31 +1466,6 @@ session.gc_maxlifetime = 1440
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; find /path/to/sessions -cmin +24 -type f | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope.
; PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It's
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won't be warned when it's
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-42
session.bug_compat_42 = Off
; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-warn
session.bug_compat_warn = Off
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
+1 -10
View File
@@ -178,15 +178,6 @@ Parse and execute
.IR file
.TP
.PD 0
.B \-\-global \fIname\fP
.TP
.PD 1
.B \-g \fIname\fP
Make variable
.IR name
global in script.
.TP
.PD 0
.B \-\-help
.TP
.PD 1
@@ -298,7 +289,7 @@ Specify the document root to be used by the built-in web server
Version number
.TP
.PD 0
.B \-\-stripped
.B \-\-strip
.TP
.PD 1
.B \-w
+3
View File
@@ -148,6 +148,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
{ "chroot", &fpm_conf_set_string, WPO(chroot) },
{ "chdir", &fpm_conf_set_string, WPO(chdir) },
{ "catch_workers_output", &fpm_conf_set_boolean, WPO(catch_workers_output) },
{ "clear_env", &fpm_conf_set_boolean, WPO(clear_env) },
{ "security.limit_extensions", &fpm_conf_set_string, WPO(security_limit_extensions) },
{ 0, 0, 0 }
};
@@ -603,6 +604,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
wp->config->pm_process_idle_timeout = 10; /* 10s by default */
wp->config->process_priority = 64; /* 64 means unset */
wp->config->clear_env = 1;
if (!fpm_worker_all_pools) {
fpm_worker_all_pools = wp;
@@ -1600,6 +1602,7 @@ static void fpm_conf_dump() /* {{{ */
zlog(ZLOG_NOTICE, "\tchroot = %s", STR2STR(wp->config->chroot));
zlog(ZLOG_NOTICE, "\tchdir = %s", STR2STR(wp->config->chdir));
zlog(ZLOG_NOTICE, "\tcatch_workers_output = %s", BOOL2STR(wp->config->catch_workers_output));
zlog(ZLOG_NOTICE, "\tclear_env = %s", BOOL2STR(wp->config->clear_env));
zlog(ZLOG_NOTICE, "\tsecurity.limit_extensions = %s", wp->config->security_limit_extensions);
for (kv = wp->config->env; kv; kv = kv->next) {
+1
View File
@@ -83,6 +83,7 @@ struct fpm_worker_pool_config_s {
char *chroot;
char *chdir;
int catch_workers_output;
int clear_env;
char *security_limit_extensions;
struct key_value_s *env;
struct key_value_s *php_admin_values;
+3 -1
View File
@@ -143,7 +143,9 @@ int fpm_env_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
fpm_env_setproctitle(title);
efree(title);
clearenv();
if (wp->config->clear_env) {
clearenv();
}
for (kv = wp->config->env; kv; kv = kv->next) {
setenv(kv->key, kv->value, 1);
+9
View File
@@ -475,6 +475,15 @@ pm.max_spare_servers = 3
; Default Value: no
;catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
+4
View File
@@ -46,6 +46,8 @@ VC_VERSIONS[1310] = 'MSVC7.1 (Visual C++ 2003)';
VC_VERSIONS[1400] = 'MSVC8 (Visual C++ 2005)';
VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)';
VC_VERSIONS[1600] = 'MSVC10 (Visual C++ 2010)';
VC_VERSIONS[1700] = 'MSVC11 (Visual C++ 2012)';
VC_VERSIONS[1800] = 'MSVC12 (Visual C++ 2013)';
var VC_VERSIONS_SHORT = new Array();
VC_VERSIONS_SHORT[1200] = 'VC6';
@@ -54,6 +56,8 @@ VC_VERSIONS_SHORT[1310] = 'VC7.1';
VC_VERSIONS_SHORT[1400] = 'VC8';
VC_VERSIONS_SHORT[1500] = 'VC9';
VC_VERSIONS_SHORT[1600] = 'VC10';
VC_VERSIONS_SHORT[1700] = 'VC11';
VC_VERSIONS_SHORT[1800] = 'VC12';
if (PROGRAM_FILES == null) {
PROGRAM_FILES = "C:\\Program Files";
+1 -1
View File
@@ -3,7 +3,7 @@ cclient-2007e
freetype-2.4.10
icu-49.1.2
jpeglib-8
libcurl-7.30.0
libcurl-7.35.0
libiconv-1.14
libmcrypt-2.5.8
libmpir-2.5.1
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff. Show more